/** * Specifies the user agent identification. Used to trigger browser-specific server behavior. * @deprecated as of 1.4.6. Use ClientProperties#setUserAgent instead. **/ public void setUserAgent( String userAgent ) { getClientProperties().setUserAgent( userAgent ); }
/** * Returns the current user agent setting. * @deprecated as of 1.4.6. Use ClientProperties#getUserAgent instead. **/ public String getUserAgent() { return getClientProperties().getUserAgent(); }
/** * Returns the current user agent setting. * @deprecated as of 1.4.6. Use ClientProperties#getUserAgent instead. **/ public String getUserAgent() { return getClientProperties().getUserAgent(); }
/** * Specifies the user agent identification. Used to trigger browser-specific server behavior. * @deprecated as of 1.4.6. Use ClientProperties#setUserAgent instead. **/ public void setUserAgent( String userAgent ) { getClientProperties().setUserAgent( userAgent ); }
/** * Returns the current user agent setting. * @deprecated as of 1.4.6. Use ClientProperties#getUserAgent instead. **/ public String getUserAgent() { return getClientProperties().getUserAgent(); }
/** * Specifies the user agent identification. Used to trigger browser-specific server behavior. * @deprecated as of 1.4.6. Use ClientProperties#setUserAgent instead. **/ public void setUserAgent( String userAgent ) { getClientProperties().setUserAgent( userAgent ); }
public ClientProperties getClientProperties() { return _client == null ? ClientProperties.getDefaultProperties() : _client.getClientProperties(); }
public ClientProperties getClientProperties() { return _client == null ? ClientProperties.getDefaultProperties() : _client.getClientProperties(); }
public ClientProperties getClientProperties() { return _client == null ? ClientProperties.getDefaultProperties() : _client.getClientProperties(); }
/** * Returns the value of all current header fields. **/ protected Dictionary getHeaderFields( URL targetURL ) { Hashtable result = (Hashtable) _headers.clone(); result.put( "User-Agent", getClientProperties().getUserAgent() ); if (getClientProperties().isAcceptGzip()) result.put( "Accept-Encoding", "gzip" ); AddHeaderIfNotNull( result, "Cookie", _cookieJar.getCookieHeaderField( targetURL ) ); if (_authorizationString == null) _authorizationString = _fixedAuthorizationString; AddHeaderIfNotNull( result, "Authorization", _authorizationString ); AddHeaderIfNotNull( result, "Proxy-Authorization", _proxyAuthorizationString ); _authorizationString = null; return result; }
/** * Returns the value of all current header fields. **/ protected Dictionary getHeaderFields( URL targetURL ) { Hashtable result = (Hashtable) _headers.clone(); result.put( "User-Agent", getClientProperties().getUserAgent() ); if (getClientProperties().isAcceptGzip()) result.put( "Accept-Encoding", "gzip" ); AddHeaderIfNotNull( result, "Cookie", _cookieJar.getCookieHeaderField( targetURL ) ); if (_authorizationString == null) _authorizationString = _fixedAuthorizationString; AddHeaderIfNotNull( result, "Authorization", _authorizationString ); AddHeaderIfNotNull( result, "Proxy-Authorization", _proxyAuthorizationString ); _authorizationString = null; return result; }
/** * Returns the value of all current header fields. **/ protected Dictionary getHeaderFields( URL targetURL ) { Hashtable result = (Hashtable) _headers.clone(); result.put( "User-Agent", getClientProperties().getUserAgent() ); if (getClientProperties().isAcceptGzip()) result.put( "Accept-Encoding", "gzip" ); AddHeaderIfNotNull( result, "Cookie", _cookieJar.getCookieHeaderField( targetURL ) ); if (_authorizationString == null) _authorizationString = _fixedAuthorizationString; AddHeaderIfNotNull( result, "Authorization", _authorizationString ); AddHeaderIfNotNull( result, "Proxy-Authorization", _proxyAuthorizationString ); _authorizationString = null; return result; }
private ClientProperties getClientProperties() { WebWindow window = _response.getWindow(); return window == null ? ClientProperties.getDefaultProperties() : window.getClient().getClientProperties(); }
private ClientProperties getClientProperties() { WebWindow window = _response.getWindow(); return window == null ? ClientProperties.getDefaultProperties() : window.getClient().getClientProperties(); }
private ClientProperties getClientProperties() { WebWindow window = _response.getWindow(); return window == null ? ClientProperties.getDefaultProperties() : window.getClient().getClientProperties(); }
void updateClient( WebResponse response ) throws IOException { if (getClientProperties().isAcceptCookies()) _cookieJar.updateCookies( response.getCookieJar() ); validateHeaders( response ); }
void updateClient( WebResponse response ) throws IOException { if (getClientProperties().isAcceptCookies()) _cookieJar.updateCookies( response.getCookieJar() ); validateHeaders( response ); }
void updateClient( WebResponse response ) throws IOException { if (getClientProperties().isAcceptCookies()) _cookieJar.updateCookies( response.getCookieJar() ); validateHeaders( response ); }
/** * check whether redirect is configured * @param response * @return */ private boolean redirectConfigured( WebResponse response ) { boolean isAutoredirect=getClient().getClientProperties().isAutoRedirect(); boolean hasLocation=response.getHeaderField( "Location" ) != null; int responseCode=response.getResponseCode(); boolean result=isAutoredirect && responseCode >= HttpURLConnection.HTTP_MOVED_PERM && responseCode <= HttpURLConnection.HTTP_MOVED_TEMP && hasLocation; return result; }
/** * check whether redirect is configured * @param response * @return */ private boolean redirectConfigured( WebResponse response ) { boolean isAutoredirect=getClient().getClientProperties().isAutoRedirect(); boolean hasLocation=response.getHeaderField( "Location" ) != null; int responseCode=response.getResponseCode(); boolean result=isAutoredirect && responseCode >= HttpURLConnection.HTTP_MOVED_PERM && responseCode <= HttpURLConnection.HTTP_MOVED_TEMP && hasLocation; return result; }