|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gargoylesoftware.htmlunit.WebClientOptions
public class WebClientOptions
Represents options of a WebClient.
| Constructor Summary | |
|---|---|
WebClientOptions()
|
|
| Method Summary | |
|---|---|
String |
getHomePage()
Returns the client's current homepage. |
boolean |
getPrintContentOnFailingStatusCode()
Returns true if the content of the resulting document will be printed to the console in the event of a failing response code. |
ProxyConfig |
getProxyConfig()
Returns the proxy configuration for this client. |
int |
getTimeout()
Gets the timeout value for the WebConnection. |
boolean |
isActiveXNative()
Returns whether native ActiveX components are allowed or no. |
boolean |
isAppletEnabled()
Returns true if Applet are enabled. |
boolean |
isCssEnabled()
Returns true if CSS is enabled. |
boolean |
isDoNotTrackEnabled()
Returns true if "Do Not Track" is enabled. |
boolean |
isGeolocationEnabled()
Returns true if Geolocation is enabled. |
boolean |
isJavaScriptEnabled()
Returns true if JavaScript is enabled and the script engine was loaded successfully. |
boolean |
isPopupBlockerEnabled()
Returns true if the popup window blocker is enabled. |
boolean |
isRedirectEnabled()
Returns whether or not redirections will be followed automatically on receipt of a redirect status code from the server. |
boolean |
isThrowExceptionOnFailingStatusCode()
Returns true if an exception will be thrown in the event of a failing response code. |
boolean |
isThrowExceptionOnScriptError()
Indicates if an exception should be thrown when a script execution fails (the default) or if it should be caught and just logged to allow page execution to continue. |
boolean |
isUseInsecureSSL()
Indicates if insecure SSL should be used. |
void |
setActiveXNative(boolean allow)
Sets whether to allow native ActiveX or no. |
void |
setAppletEnabled(boolean enabled)
Enables/disables Applet support. |
void |
setCssEnabled(boolean enabled)
Enables/disables CSS support. |
void |
setDoNotTrackEnabled(boolean enabled)
Enables/disables "Do Not Track" support. |
void |
setGeolocationEnabled(boolean enabled)
Enables/disables Geolocation support. |
void |
setHomePage(String homePage)
Sets the client's homepage. |
void |
setJavaScriptEnabled(boolean enabled)
Enables/disables JavaScript support. |
void |
setPopupBlockerEnabled(boolean enabled)
Enable/disable the popup window blocker. |
void |
setPrintContentOnFailingStatusCode(boolean enabled)
Specify whether or not the content of the resulting document will be printed to the console in the event of a failing response code. |
void |
setProxyConfig(ProxyConfig proxyConfig)
Sets the proxy configuration for this client. |
void |
setRedirectEnabled(boolean enabled)
Sets whether or not redirections will be followed automatically on receipt of a redirect status code from the server. |
void |
setSSLClientCertificate(URL certificateUrl,
String certificatePassword,
String certificateType)
Sets the SSL client certificate to use. |
void |
setThrowExceptionOnFailingStatusCode(boolean enabled)
Specify whether or not an exception will be thrown in the event of a failing status code. |
void |
setThrowExceptionOnScriptError(boolean enabled)
Changes the behavior of this webclient when a script error occurs. |
void |
setTimeout(int timeout)
Sets the timeout of the WebConnection. |
void |
setUseInsecureSSL(boolean useInsecureSSL)
If set to true, the client will accept connections to any host, regardless of
whether they have valid certificates or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebClientOptions()
| Method Detail |
|---|
public void setUseInsecureSSL(boolean useInsecureSSL)
true, the client will accept connections to any host, regardless of
whether they have valid certificates or not. This is especially useful when you are trying to
connect to a server with expired or corrupt certificates.
useInsecureSSL - whether or not to use insecure SSLpublic boolean isUseInsecureSSL()
true if insecure SSL should be used. Default is false.public void setRedirectEnabled(boolean enabled)
enabled - true to enable automatic redirectionpublic boolean isRedirectEnabled()
public void setSSLClientCertificate(URL certificateUrl,
String certificatePassword,
String certificateType)
KeyStore.
If the web server requires Renegotiation, you have to set sytem property
"sun.security.ssl.allowUnsafeRenegotiation" to true, as hinted in
TLS Renegotiation Issue.
certificateUrl - the URL which locates the certificatecertificatePassword - the certificate passwordcertificateType - the type of certificate, usually "jks" or "pkcs12".public void setJavaScriptEnabled(boolean enabled)
enabled - true to enable JavaScript supportpublic boolean isJavaScriptEnabled()
public void setCssEnabled(boolean enabled)
enabled - true to enable CSS supportpublic boolean isCssEnabled()
public void setAppletEnabled(boolean enabled)
Note: as of HtmlUnit-2.4, Applet support is experimental and minimal
enabled - true to enable Applet supportpublic boolean isAppletEnabled()
public void setPopupBlockerEnabled(boolean enabled)
enabled - true to enable the popup window blockerpublic boolean isPopupBlockerEnabled()
public void setGeolocationEnabled(boolean enabled)
enabled - true to enable Geolocation supportpublic boolean isGeolocationEnabled()
public void setDoNotTrackEnabled(boolean enabled)
enabled - true to enable "Do Not Track" supportpublic boolean isDoNotTrackEnabled()
public void setPrintContentOnFailingStatusCode(boolean enabled)
enabled - True to enable this featurepublic boolean getPrintContentOnFailingStatusCode()
setPrintContentOnFailingStatusCode(boolean)public void setThrowExceptionOnFailingStatusCode(boolean enabled)
enabled - true to enable this featurepublic boolean isThrowExceptionOnFailingStatusCode()
setThrowExceptionOnFailingStatusCode(boolean)public boolean isThrowExceptionOnScriptError()
true if an exception is thrown on script error (the default)public void setThrowExceptionOnScriptError(boolean enabled)
enabled - indicates if exception should be thrown or notpublic void setActiveXNative(boolean allow)
allow - whether to allow or nopublic boolean isActiveXNative()
public String getHomePage()
public void setHomePage(String homePage)
homePage - the new homepage URLpublic ProxyConfig getProxyConfig()
public void setProxyConfig(ProxyConfig proxyConfig)
proxyConfig - the proxy configuration for this clientpublic int getTimeout()
WebConnection.
WebClientOptions#getTimeout(int)public void setTimeout(int timeout)
Sets the timeout of the WebConnection. Set to zero (the default) for an infinite wait.
Note: The timeout is used twice. The first is for making the socket connection, the second is for data retrieval. If the time is critical you must allow for twice the time specified here.
timeout - the value of the timeout in milliseconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||