ClientProperties cloneProperties() { return new ClientProperties( this ); }
/** * Returns the properties associated with this client. */ public ClientProperties getClientProperties() { if (_clientProperties == null) { _clientProperties = ClientProperties.getDefaultProperties().cloneProperties(); } return _clientProperties; }
public String jsGet_appCodeName() { return _clientProperties.getApplicationCodeName(); }
/** * Returns true if HttpUnit is accepting and saving cookies. The default is to accept them. * @deprecated as of 1.5.3, use ClientProperties#isAcceptCookies(); */ public static boolean isAcceptCookies() { return ClientProperties.getDefaultProperties().isAcceptCookies(); }
/** * Specifies whether HttpUnit should automatically follow page refresh requests. * By default, this is false, so that programs can verify the redirect page presented * to users before the browser switches to the new page. Setting this to true can * cause an infinite loop on pages that refresh themselves. * @deprecated as of 1.5.3, use ClientProperties#setAutoRefresh(); **/ public static void setAutoRefresh( boolean autoRefresh ) { ClientProperties.getDefaultProperties().setAutoRefresh( autoRefresh ); }
/** * Specifies whether HttpUnit should accept and send cookies. * @deprecated as of 1.5.3, use ClientProperties#setAcceptCookies(); */ public static void setAcceptCookies( boolean acceptCookies ) { ClientProperties.getDefaultProperties().setAcceptCookies( acceptCookies ); }
/** * Returns true if any WebClient created will accept GZIP encoding of responses. The default is to accept GZIP encoding. * @deprecated as of 1.5.3, use ClientProperties#isAcceptGzip(); **/ public static boolean isAcceptGzip() { return ClientProperties.getDefaultProperties().isAcceptGzip(); }
/** * Returns true if HttpUnit should automatically follow page redirect requests (status 3xx). * By default, this is true. * @deprecated as of 1.5.3, use ClientProperties#isAutoRedirect(); **/ public static boolean getAutoRedirect() { return ClientProperties.getDefaultProperties().isAutoRedirect(); }
/** * Determines whether HttpUnit should automatically follow page redirect requests (status 3xx). * By default, this is true in order to simulate normal browser operation. * @deprecated as of 1.5.3, use ClientProperties#setAutoRedirect(); **/ public static void setAutoRedirect( boolean autoRedirect ) { ClientProperties.getDefaultProperties().setAutoRedirect( autoRedirect ); }
/** * Specifies whether a WebClient will be initialized to accept GZIP encoded responses. The default is true. * @deprecated as of 1.5.3, use ClientProperties#setAcceptGzip(); */ public static void setAcceptGzip( boolean acceptGzip ) { ClientProperties.getDefaultProperties().setAcceptGzip( acceptGzip ); }
/** * Returns true if HttpUnit should automatically follow page refresh requests. * By default, this is false, so that programs can verify the redirect page presented * to users before the browser switches to the new page. * @deprecated as of 1.5.3, use ClientProperties#isAutoRefresh(); **/ public static boolean getAutoRefresh() { return ClientProperties.getDefaultProperties().isAutoRefresh(); }
public ClientProperties getClientProperties() { return _client == null ? ClientProperties.getDefaultProperties() : _client.getClientProperties(); }
public int jsGet_availHeight() { return _clientProperties.getAvailHeight(); }
public String jsGet_appName() { return _clientProperties.getApplicationName(); }
public String jsGet_appVersion() { return _clientProperties.getApplicationVersion(); }
public int jsGet_availWidth() { return _clientProperties.getAvailableScreenWidth(); }
/** * get the Uniform Resource Locator for this request * @param request * @return the URL * @throws MalformedURLException */ private URL getRequestURL( WebRequest request ) throws MalformedURLException { DNSListener dnsListener = getClientProperties().getDnsListener(); if (dnsListener == null) return request.getURL(); String hostName = request.getURL().getHost(); String portPortion = request.getURL().getPort() == -1 ? "" : (":" + request.getURL().getPort()); setHeaderField( "Host", hostName + portPortion ); String actualHost = dnsListener.getIpAddress( hostName ); if (HttpUnitOptions.isLoggingHttpHeaders()) System.out.println( "Rerouting request to :: " + actualHost ); return new URL( request.getURL().getProtocol(), actualHost, request.getURL().getPort(), request.getURL().getFile() ); }
private void readContentTypeHeader() { String contentHeader = (_contentHeader != null) ? _contentHeader : getHeaderField( "Content-type" ); if (contentHeader == null) { _contentType = HttpUnitOptions.getDefaultContentType(); setCharacterSet( HttpUnitOptions.getDefaultCharacterSet() ); _contentHeader = _contentType + ";charset=" + _characterSet; } else { String[] parts = HttpUnitUtils.parseContentTypeHeader( contentHeader ); if (null != _client && null != _client.getClientProperties().getOverrideContextType()) { _contentType = _client.getClientProperties().getOverrideContextType(); } else { _contentType = parts[0]; } if (parts[1] != null) setCharacterSet( parts[1] ); } }
/** * Returns true if HttpUnit is accepting and saving cookies. The default is to accept them. * @deprecated as of 1.5.3, use ClientProperties#isAcceptCookies(); */ public static boolean isAcceptCookies() { return ClientProperties.getDefaultProperties().isAcceptCookies(); }
/** * Specifies whether HttpUnit should automatically follow page refresh requests. * By default, this is false, so that programs can verify the redirect page presented * to users before the browser switches to the new page. Setting this to true can * cause an infinite loop on pages that refresh themselves. * @deprecated as of 1.5.3, use ClientProperties#setAutoRefresh(); **/ public static void setAutoRefresh( boolean autoRefresh ) { ClientProperties.getDefaultProperties().setAutoRefresh( autoRefresh ); }