|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.URLConnection
java.net.HttpURLConnection
com.oaklandsw.http.HttpURLConnection
A URLConnection with support for HTTP-specific features.
The following properties can be used with this class:
http.proxyHost
- specifies the host of the proxy server. Note
this is identical to the method to specify the proxy host for the
java.net.HttpURLConnection. See setProxyHost().
http.proxyPort
- specifies the port of the proxy server. Note
this is identical to the method to specify the proxy port for the
java.net.HttpURLConnection. See setProxyPort(). Used in conjunction with
http.proxyHost
.
https.proxyHost
- specifies the host of the proxy server. Note
this is identical to the method to specify the proxy host for the
java.net.HttpURLConnection. See setProxyHost(). Indicates the proxy server
uses SSL. If both this and http.proxyHost
as specified, this
will take precedence.
https.proxyPort
- specifies the port of the proxy server. Note
this is identical to the method to specify the proxy port for the
java.net.HttpURLConnection. See setProxyPort(). Indicates the proxy server
uses SSL. Used in conjunction with https.proxyPort.
http.proxyUser
- specifies the user name used for authentication
with a proxy server if required. Note this is identical to the method to
specify the proxy user for the java.net.HttpURLConnection. See setProxyUser()
http.proxyPassword
- specifies the password used for
authentication with a proxy server if required. Note this is identical to the
method to specify the proxy password for the java.net.HttpURLConnection. See
setProxyPassword().
http.nonProxyHosts
- specifies a list of hosts to not direct to
the proxy server. Note this is identical to the method to specify such hosts
as for the java.net.HttpURLConnection. See setNonProxyHosts().
proxySet
- setting this to any value causes all requests to go
through the proxy server specified by proxyHost
and
proxyPort
. Note that this method is obsolete and provided only
for compatibility with JDK 1.0.2 implementations. The preferred method is to
use http.proxyHost/Port
. See setProxyHost()/setProxyPort().
proxyHost
- specifies the host of the proxy server. Note this is
identical to the method to specify the proxy host for the
java.net.HttpURLConnection. This only works if proxySet
is set
to something. Note that this method is obsolete and provided only for
compatibility with JDK 1.0.2 implementations. The preferred method is to use
http.proxyHost
. See setProxyHost().
proxyPort
- specifies the port of the proxy server. Note this is
identical to the method to specify the proxy port for the
java.net.HttpURLConnection. This only works if proxySet
is set
to something. Note that this method is obsolete and provided only for
compatibility with JDK 1.0.2 implementations. The preferred method is to use
http.proxyPort
. See setProxyPort().
com.oaklandsw.http.timeout
- specifies the timeout value in
milliseconds. See setDefaultTimeout().
com.oaklandsw.http.idleConnectionTimeout
- the number of
milliseconds that a connection can be idle before it is removed from the
connection pool. See setIdleConnectionTimeout() and
setDefaultIdleConnectionTimeout().
com.oaklandsw.http.idleConnectionPing
- this is used to ping the
connection before sending a POST request. The ping is issued if the
connection was idle for at least the number of milliseconds specified. See
setIdleConnectionPing() and setDefaultIdleConnectionPing().
com.oaklandsw.http.connectionRequestLimit
- this is used to limit
the number of requests on a connection. Once this limit is reached, the
connection is closed. See setConnectionRequestLimit() and
setDefaultConnectionRequestLimit().
com.oaklandsw.http.maxConnectionsPerHost
- sets the maximum
number of connections allowed to a given host:port. If not specified, a
default of 2 is assumed. See setMaxConnectionsPerHost().
com.oaklandsw.http.tries
- the number of times to try a sending
an idempotent request if there is a problem with getting the response. Also
the number of times to try an idle connection ping on a POST request if this
is enabled. The default is 3. See setTries().
com.oaklandsw.http.retryInterval
- the number of milliseconds to
wait before retrying an idempotent request. The default is 0ms. See
setRetryInterval().
com.oaklandsw.http.pipelining
- set to any value to enable
pipelining requests. The default is not set. See setDefaultPipelining().
com.oaklandsw.http.authenticationType
- used to indicate a
preferred authentication mode for pipelining or streaming. Set to one of
"basic", "digest", or "ntlm". The default is not set. See
setDefaultAuthenticationType().
com.oaklandsw.http.proxyAuthenticationType
- used to indicate a
preferred authentication mode for pipelining or streaming. Set to one of
"basic", "digest", or "ntlm". The default is not set. See
setDefaultProxyAuthenticationType().
com.oaklandsw.http.userAgent
- set to specify an alternate value
for the User-Agent HTTP header. The default is that the User-Agent header is
set to DEFAULT_USER_AGENT.
com.oaklandsw.http.followRedirectsPost
- specifies that redirect
response codes are followed for a POST request. see setFollowRedirectsPost()
for further details. The default is to not follow redirect response codes for
post.
com.oaklandsw.http.cookiePolicy
- specifies the default cookie
policy to be used. See CookiePolicy for the possible values.
com.oaklandsw.http.skipEnvironmentInit
- specified that all
property settings are to be ignored. The property settings are normally read
in the static initializer of this class. If this property is set none of the
properties will be read. This is used in environments where the settings of
some system properties might be for other HTTP client implementations.
Field Summary | |
static int |
AUTH_NORMAL
|
static int |
AUTH_PROXY
|
static int |
DEFAULT_MAX_CONNECTIONS
|
static int |
DEFAULT_RECEIVE_BUFFER_SIZE
The default size of the socket read buffer. |
static int |
DEFAULT_SEND_BUFFER_SIZE
The default size of the socket write buffer. |
static java.lang.String |
DEFAULT_USER_AGENT
|
static java.lang.String |
HTTP_METHOD_CONNECT
|
static java.lang.String |
HTTP_METHOD_DELETE
|
static java.lang.String |
HTTP_METHOD_GET
|
static java.lang.String |
HTTP_METHOD_HEAD
|
static java.lang.String |
HTTP_METHOD_OPTIONS
|
static java.lang.String |
HTTP_METHOD_POST
|
static java.lang.String |
HTTP_METHOD_PUT
|
static java.lang.String |
HTTP_METHOD_TRACE
|
static int |
MAX_TRIES
|
static int |
METHOD_PROP_ADD_CL_HEADER
Add the content-length header if not already specified. |
static int |
METHOD_PROP_CALCULATE_CONTENT_LEN
The content length value is calculated (for potentially adding a content-length header) (POST/PUT). |
static int |
METHOD_PROP_IGNORE_RESPONSE_BODY
The response body is ignored. |
static int |
METHOD_PROP_LEAVE_OPEN
The connection is left open for this method (CONNECT) |
static int |
METHOD_PROP_REDIRECT
This method will follow redirects. |
static int |
METHOD_PROP_REQ_LINE_HOST_PORT
The request line has only the host/port (CONNECT) |
static int |
METHOD_PROP_REQ_LINE_STAR
The request line consists of only a "*" (for OPTIONS) |
static int |
METHOD_PROP_REQ_LINE_URL
The request line has a URL (most HTTP methods) |
static int |
METHOD_PROP_RETRY
This method will be retried automatically. |
static int |
METHOD_PROP_SEND_CONTENT_TYPE
A content-type header is automatically added (PUT). |
static int |
METHOD_PROP_SUPPORTS_TUNNELED
This method supports the tunneling streaming mode (CONNECT) |
static int |
METHOD_PROP_SWITCH_TO_POST
This is used for an HTTP GET method. |
static int |
METHOD_PROP_UNKNOWN_METHOD
A method was specified, but is not known (in the table of methods) |
static int |
METHOD_PROP_UNSPECIFIED_METHOD
This is what the method properties are set to initially, this value indicates no method was specified. |
static int |
NTLM_ENCODING_OEM
|
static int |
NTLM_ENCODING_UNICODE
|
static int |
PIPE_MAX_CONNECTIONS
Use as many connections as possible (up to the maximum number of connections to a host/port), spreading the requests across all available connections evenly. |
static int |
PIPE_NONE
|
static int |
PIPE_PIPELINE
Use pipelining |
static int |
PIPE_STANDARD_OPTIONS
|
static int |
SOCKET_RECEIVE
|
static int |
SOCKET_SEND
|
static java.lang.String |
WEBDAV_METHOD_ACL
|
static java.lang.String |
WEBDAV_METHOD_BASELINE_CONTROL
|
static java.lang.String |
WEBDAV_METHOD_CHECKIN
|
static java.lang.String |
WEBDAV_METHOD_CHECKOUT
|
static java.lang.String |
WEBDAV_METHOD_COPY
|
static java.lang.String |
WEBDAV_METHOD_DELETE
|
static java.lang.String |
WEBDAV_METHOD_LOCK
|
static java.lang.String |
WEBDAV_METHOD_MERGE
|
static java.lang.String |
WEBDAV_METHOD_MKCOL
|
static java.lang.String |
WEBDAV_METHOD_MKWORKSPACE
|
static java.lang.String |
WEBDAV_METHOD_MOVE
|
static java.lang.String |
WEBDAV_METHOD_PROPFIND
|
static java.lang.String |
WEBDAV_METHOD_PROPPATCH
|
static java.lang.String |
WEBDAV_METHOD_REPORT
|
static java.lang.String |
WEBDAV_METHOD_SEARCH
|
static java.lang.String |
WEBDAV_METHOD_UNCHECKOUT
|
static java.lang.String |
WEBDAV_METHOD_UNLOCK
|
static java.lang.String |
WEBDAV_METHOD_UPDATE
|
static java.lang.String |
WEBDAV_METHOD_VERSION_CONTROL
|
Fields inherited from class java.net.HttpURLConnection |
HTTP_ACCEPTED, HTTP_BAD_GATEWAY, HTTP_BAD_METHOD, HTTP_BAD_REQUEST, HTTP_CLIENT_TIMEOUT, HTTP_CONFLICT, HTTP_CREATED, HTTP_ENTITY_TOO_LARGE, HTTP_FORBIDDEN, HTTP_GATEWAY_TIMEOUT, HTTP_GONE, HTTP_INTERNAL_ERROR, HTTP_LENGTH_REQUIRED, HTTP_MOVED_PERM, HTTP_MOVED_TEMP, HTTP_MULT_CHOICE, HTTP_NO_CONTENT, HTTP_NOT_ACCEPTABLE, HTTP_NOT_AUTHORITATIVE, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_NOT_MODIFIED, HTTP_OK, HTTP_PARTIAL, HTTP_PAYMENT_REQUIRED, HTTP_PRECON_FAILED, HTTP_PROXY_AUTH, HTTP_REQ_TOO_LONG, HTTP_RESET, HTTP_SEE_OTHER, HTTP_SERVER_ERROR, HTTP_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION |
Constructor Summary | |
HttpURLConnection()
|
|
HttpURLConnection(java.net.URL urlParam)
Constructor, works the same as the constructor for java.net.HttpURLConnection. |
Method Summary | |
void |
addRequestProperty(java.lang.String key,
java.lang.String value)
|
static void |
closeAllPooledConnections()
Close all pooled connections that are not currently in use. |
void |
connect()
|
void |
disconnect()
|
static java.lang.String |
dumpAll()
|
static void |
dumpAll(java.io.PrintWriter out)
|
void |
finalize()
Releases the associated transport collection when this object is to be collected. |
java.lang.String |
getAuthenticationDummyContent()
For internal use only (public for testing) |
java.lang.String |
getAuthenticationDummyMethod()
For internal use only (public for testing) |
int |
getAuthenticationType()
Returns the authentication type associated with this connection. |
Callback |
getCallback()
Gets the Callback object associated with this connection. |
java.lang.String |
getCipherSuite()
Returns the cipher suite associated with this connection. |
HttpConnection |
getConnection()
Returns the connection associated with this object, if any. |
static HttpConnectionManager |
getConnectionManager()
Returns the HttpConnectionManager |
static java.lang.String |
getConnectionPool()
Prints all pooled connections to System.out. |
java.lang.String |
getConnectionProxyHost()
Returns the current value of the proxy server host on this connection. |
java.lang.String |
getConnectionProxyPassword()
Returns the current value of the proxy server password on this connection. |
int |
getConnectionProxyPort()
Returns the current value of the proxy server port number. |
java.lang.String |
getConnectionProxyUser()
Returns the current value of the proxy user on this connection. |
int |
getConnectionRequestLimit()
Return the connection request limit value associated with this connection. |
int |
getConnectionTimeout()
Return the connection timeout value associated with this connection. |
CookieContainer |
getCookieContainer()
Returns the CookieContainer associated with this request. |
java.lang.String |
getCookiePolicy()
Returns the CookiePolicy string associated with this request. |
static int |
getDefaultAuthenticationType()
Gets the default authentication type. |
static Callback |
getDefaultCallback()
Returns the default Callback object. |
static int |
getDefaultConnectionRequestLimit()
Return the default idle connection ping value. |
static int |
getDefaultConnectionTimeout()
Return the default connection timeout value. |
static HostnameVerifier |
getDefaultHostnameVerifier()
Returns the default hostname verifier used for SSL connections. |
static int |
getDefaultIdleConnectionPing()
Return the default idle connection ping value. |
static int |
getDefaultIdleConnectionTimeout()
Return the default idle connection timeout value. |
static int |
getDefaultMaxForwards()
Get the number of forwards and authentication retries allowed. |
static int |
getDefaultMaxTries()
Get the number of times an idempotent request is tried. |
static int |
getDefaultPipeliningMaxDepth()
Get the value of the maximum depth of pipelining for all connections. |
static int |
getDefaultPipeliningOptions()
Get the value of pipelining options for all connections. |
static int |
getDefaultProxyAuthenticationType()
Gets the default proxy authentication type. |
static int |
getDefaultRequestTimeout()
Return the default request timeout value. |
static AbstractSocketFactory |
getDefaultSocketFactory()
Returns the default socket factory used for HTTP socket connections. |
static javax.net.ssl.SSLSocketFactory |
getDefaultSSLSocketFactory()
Returns the default SSL socket factory used for SSL connections. |
static boolean |
getDefaultThrowFileNotFoundOn404()
For JRE compatibility throw a FileNotFoundException when a 404 response is detected. |
static int |
getDefaultTimeout()
Deprecated. please use getDefaultConnectionTimeout() or getDefaultRequestTimeout() |
static HttpUserAgent |
getDefaultUserAgent()
Gets the default user agent. |
boolean |
getDoAuthentication()
Automatic processing of responses where authentication is required (status codes 401 and 407). |
java.io.InputStream |
getErrorStream()
Returns the data associated with the connection in the event of an error. |
java.lang.String |
getHeaderField(int position)
|
java.lang.String |
getHeaderField(java.lang.String name)
|
java.lang.String |
getHeaderFieldKey(int keyPosition)
|
java.util.Map |
getHeaderFields()
|
int |
getHeadersLength()
Returns the number of response headers. |
HostnameVerifier |
getHostnameVerifier()
Returns the hostname verifier used for this SSL connection. |
int |
getIdleConnectionPing()
Return the idle connection ping value associated with this connection. |
int |
getIdleConnectionTimeout()
Return the idle connection timeout value associated with this connection. |
java.io.InputStream |
getInputStream()
Gets an InputStream for the data returned in the response. |
boolean |
getInstanceFollowRedirects()
Whether or not I should automatically follow HTTP redirects (status code 302, etc) Redirects are followed only for GET, POST, or HEAD requests. |
java.security.cert.Certificate[] |
getLocalCertificates()
Returns the certificates(s) that were sent to the server when the connection was established. |
static int |
getMaxConnectionsPerHost()
Get the maximum number of connections allowed for a given host:port. |
static boolean |
getMultiCredentialsPerAddress()
Allow multiple sets of authentication credentials per destination Internet address (host/port). |
static java.lang.String |
getNonProxyHosts()
Returns the current value of the hosts to not be accessed through the proxy server. |
static int |
getNtlmPreferredEncoding()
Gets the preferred encoding for NTLM messages. |
java.io.OutputStream |
getOutputStream()
|
int |
getPipeliningMaxDepth()
Get the value of the maximum depth of pipelining for this connection. |
int |
getPipeliningOptions()
Get the value of pipelining options for this connection. |
static boolean |
getPreemptiveAuthentication()
Deprecated. |
int |
getProxyAuthenticationType()
Returns the proxy authentication type associated with this connection. |
static java.lang.String |
getProxyHost()
Returns the current value of the proxy server host. |
static java.lang.String |
getProxyPassword()
Returns the current value of the proxy password. |
static int |
getProxyPort()
Returns the current value of the proxy server port number. |
static java.lang.String |
getProxyUser()
Returns the current value of the proxy server user. |
java.io.Reader |
getReader()
Gets a Reader for the data returned in the response. |
java.lang.String |
getRequestProperty(java.lang.String key)
|
int |
getRequestTimeout()
Return the request timeout value associated with this connection. |
int |
getResponseCode()
|
java.lang.String |
getResponseMessage()
|
static int |
getRetryInterval()
Get the interval to wait before each retry of a failed request. |
java.security.cert.Certificate[] |
getServerCertificates()
Returns the server's certificate chain that was established when the session was setup. |
static int |
getSocketBufferSize(int type)
Gets the buffer size to be used for the underlying sockets for all connections. |
AbstractSocketFactory |
getSocketFactory()
Returns the socket factory used for this HTTP socket connection. |
javax.net.ssl.SSLSocketFactory |
getSSLSocketFactory()
Returns the SSL socket factory used this SSL connection. |
static java.lang.String |
getStaticConfiguration()
|
static java.lang.String |
getStatistics()
Returns various statistics in printed form |
int |
getTimeout()
Deprecated. please use either getConnectionTimeout() or getRequestTimeout() |
static int |
getTries()
Deprecated. please use getDefaultMaxTries() |
java.lang.String |
getUrlString()
|
static boolean |
getUse10KeepAlive()
Get the option to include the HTTP 1.0 Keep-Alive headers in HTTP requests. |
HttpUserAgent |
getUserAgent()
Sets the user agent for this connection. |
static void |
immediateShutdown()
Immediately close all connections and stop all work in progress. |
boolean |
isConnected()
Returns true if this connection is currently connected. |
boolean |
isConnectionProxySsl()
Returns true if the proxy is to use SSL for this connection. |
static boolean |
isDefaultForceSSL()
Gets the value indicating if SSL is forced for this all URL connections. |
static boolean |
isDefaultPipelining()
Get the value of pipelining enablement for all connections. |
static boolean |
isExplicitClose()
Deprecated. |
boolean |
isForceSSL()
Gets the value indicating if SSL is forced for this URL connection. |
static boolean |
isNonProxyHost(java.lang.String hostName)
Returns true if the specified host is treated as a non-proxy host. |
boolean |
isPipelining()
Get the value of pipelining enablement for this connection. |
static boolean |
isProxySsl()
Returns true if the proxy is to use SSL for all connections. |
static HttpURLConnection |
openConnection(java.net.URL url)
Creates an HTTP connection directly, without using the URLStreamHandler. |
static void |
pipelineBlock()
Blocks until all pipelined HttpURLConnections are completed on this thread. |
void |
pipelineExecute()
Begins the pipelined execution of this connection. |
void |
pipelineExecuteAsync()
Begins the pipelined execution of this connection, when you don't need to block for completion of the connection or if this thread cannot tolerate blocking. |
static java.lang.String |
plOptionsToString(int options)
Returns a string representation of the specified pipelining options. |
static void |
resetCachedCredentials()
Flushes all cached credentials. |
static void |
resetGlobalState()
Resets the global persistent state. |
static void |
resetStatistics()
Resets the statistics counters. |
static void |
resetUrlConReleased()
|
void |
setAuthenticationDummyContent(java.lang.String authenticationDummyContent)
For internal use only (public for testing) |
void |
setAuthenticationDummyMethod(java.lang.String authenticationDummyMethod)
For internal use only (public for testing) |
void |
setAuthenticationType(int authenticationType)
Sets the authentication type for this connection used for pipelining or streaming. |
void |
setCallback(Callback cb)
Sets the Callback object associated with this connection. |
void |
setChunkedStreamingMode(int chunkLen)
Used to allow data to be sent on with the HTTP request using chunked encoding. |
void |
setConnection(HttpConnection conn)
Associates a connection with this object. |
void |
setConnectionProxyHost(java.lang.String host)
Sets the host to be used as a proxy server for this connection. |
void |
setConnectionProxyPassword(java.lang.String password)
Sets the password to be used to authenticate with the proxy server for this connection. |
void |
setConnectionProxyPort(int port)
Sets the port on the proxy server host. |
void |
setConnectionProxySsl(boolean ssl)
Enables or disables the use of SSL for the proxy. |
void |
setConnectionProxyUser(java.lang.String user)
Sets the user to be used to authenticate with the proxy server. |
void |
setConnectionRequestLimit(int requests)
Sets the number of HttpURLConnection requests that can be used on the underlying socket connection. |
void |
setConnectionTimeout(int ms)
Set the connection timeout value associated with this connection. |
void |
setCookieSupport(CookieContainer container,
java.lang.String policy)
Associates the given CookieContainer with this connection. |
static void |
setDefaultAuthenticationType(int type)
Sets the default authentication type. |
static void |
setDefaultCallback(Callback cb)
Sets the Callback object for all connections. |
static void |
setDefaultConnectionRequestLimit()
Set the default idle connection ping value to its default value (0 seconds). |
static void |
setDefaultConnectionRequestLimit(int requests)
Set the default idle connection request limit value. |
static void |
setDefaultConnectionTimeout(int ms)
Set the default connection timeout value. |
static void |
setDefaultCookieSupport(CookieContainer container,
java.lang.String policy)
|
static void |
setDefaultForceSSL(boolean forceSSL)
Forces the URL connection to use SSL regardless of the protocol specified for all connections. |
static void |
setDefaultHostnameVerifier(HostnameVerifier verifier)
Sets the default hostname verifier used for SSL connections |
static void |
setDefaultIdleConnectionPing()
Set the default idle connection ping value to its default value (0 seconds). |
static void |
setDefaultIdleConnectionPing(int ms)
Set the default idle connection ping value. |
static void |
setDefaultIdleConnectionTimeout()
Set the default idle connection timeout value to its default value (14 seconds). |
static void |
setDefaultIdleConnectionTimeout(int ms)
Set the default idle connection timeout value. |
static void |
setDefaultMaxForwards(int forwards)
Set the number of times a request can be redirected or it can have its authentication retried in the event of an authentication failure (particularly in a pipelined environment). |
static void |
setDefaultMaxTries(int tries)
Set the number of times an idempotent request is to be tried before considering it a failure. |
static void |
setDefaultPipelining(boolean enabled)
Enable pipelining for all connections. |
static void |
setDefaultPipeliningMaxDepth(int pipeliningMaxDepth)
Sets the maximum depth of pipelining for all connections. |
static void |
setDefaultPipeliningOptions(int pipeliningOptions)
Set specific pipeline options for all connections. |
static void |
setDefaultProxyAuthenticationType(int type)
Sets the default proxy authentication type. |
static void |
setDefaultRequestTimeout(int ms)
Set the default request timeout value. |
static void |
setDefaultSocketFactory(AbstractSocketFactory factory)
Sets the default socket factory used for HTTP socket connections. |
static void |
setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory factory)
Sets the default SSL socket factory used for SSL connections. |
static void |
setDefaultThrowFileNotFoundOn404(boolean doThrow)
For JRE compatibility throw a FileNotFoundException when a 404 response is detected. |
static void |
setDefaultTimeout(int ms)
Set the default timeout value. |
static void |
setDefaultUserAgent(HttpUserAgent userAgent)
Sets the default user agent. |
void |
setDoAuthentication(boolean doAuthentication)
Automatic processing of responses where authentication is required (status codes 401 and 407). |
static void |
setExplicitClose(boolean explicitClose)
Deprecated. |
void |
setFixedLengthStreamingMode(int fixedLen)
Used to allow data to be sent on with the HTTP request without buffering and when the length of the data is known in advance. |
void |
setForceSSL(boolean forceSSL)
Forces the URL connection to use SSL regardless of the protocol specified. |
void |
setHostnameVerifier(HostnameVerifier verifier)
Sets the hostname verifier used for this SSL connection |
void |
setIdleConnectionPing(int ms)
Set the idle connection ping value associated with this connection. |
void |
setIdleConnectionTimeout(int ms)
Set the idle connection timeout value associated with this connection. |
void |
setInstanceFollowRedirects(boolean followRedirects)
Set whether or not I should automatically follow HTTP redirects (status code 302, etc). |
static void |
setMaxConnectionsPerHost(int maxConnections)
Set the maximum number of connections allowed for a given host:port. |
static void |
setMethodProperties(java.lang.String methodName,
int properties)
Sets the properties for the specified method to the specified property value. |
static void |
setMultiCredentialsPerAddress(boolean multi)
Allow multiple sets of authentication credentials per destination Internet address (host/port). |
static void |
setNonProxyHosts(java.lang.String hosts)
Sets the hosts to be excluded from the proxy mechanism. |
static void |
setNtlmPreferredEncoding(int encoding)
Sets the preferred encoding for NTLM authenticate messages. |
void |
setPipelining(boolean enabled)
Enable pipelining for this connection. |
void |
setPipeliningMaxDepth(int pipeliningMaxDepth)
Sets the maximum depth of pipelining for this connection. |
void |
setPipeliningOptions(int pipeliningOptions)
Set specific pipeline options for this connection. |
static void |
setPreemptiveAuthentication(boolean enabled)
Deprecated. |
void |
setProxyAuthenticationType(int authenticationType)
Sets the proxy authentication type for this connection. |
static void |
setProxyHost(java.lang.String host)
Sets the host to be used as a proxy server. |
static void |
setProxyPassword(java.lang.String password)
Sets the password to be used to authenticate with the proxy server for this connection. |
static void |
setProxyPort(int port)
Sets the port on the proxy server host. |
static void |
setProxySsl(boolean ssl)
Enables or disables the use of SSL for the proxy for all connections. |
static void |
setProxyUser(java.lang.String user)
Sets the user to be used to authenticate with the proxy server. |
void |
setRawStreamingMode(boolean useRaw)
Used to allow direct access to sending the HTTP request. |
void |
setRequestMethod(java.lang.String meth)
|
void |
setRequestProperty(java.lang.String key,
java.lang.String value)
|
void |
setRequestTimeout(int ms)
Set the request timeout value associated with this connection. |
static void |
setRetryInterval(int ms)
Set the interval to wait before each retry of a failed request. |
static void |
setSocketBufferSize(int type,
int size)
Sets the buffer size to be used for the underlying sockets for all connections. |
void |
setSocketFactory(AbstractSocketFactory factory)
Sets the default socket factory used for this HTTP socket connection. |
void |
setSSLSocketFactory(javax.net.ssl.SSLSocketFactory factory)
Sets the SSL socket factory used for this SSL connection. |
void |
setTimeout(int ms)
Set the timeout value associated with this connection. |
static void |
setTries(int tries)
Deprecated. please use setDefaultMaxTries() |
void |
setTunneledStreamingMode(boolean useTunneled)
Used to allow direct access to a tunneled connection. |
static void |
setUse10KeepAlive(boolean use)
Set the option to include the HTTP 1.0 Keep-Alive headers in HTTP requests. |
void |
setUserAgent(HttpUserAgent userAgent)
Sets the user agent for this connection. |
java.lang.String |
toString()
|
boolean |
usingProxy()
|
Methods inherited from class java.net.HttpURLConnection |
getFollowRedirects, getHeaderFieldDate, getPermission, getRequestMethod, setFollowRedirects |
Methods inherited from class java.net.URLConnection |
getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldInt, getIfModifiedSince, getLastModified, getRequestProperties, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setUseCaches |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String HTTP_METHOD_GET
public static final java.lang.String HTTP_METHOD_POST
public static final java.lang.String HTTP_METHOD_PUT
public static final java.lang.String HTTP_METHOD_OPTIONS
public static final java.lang.String HTTP_METHOD_DELETE
public static final java.lang.String HTTP_METHOD_HEAD
public static final java.lang.String HTTP_METHOD_TRACE
public static final java.lang.String HTTP_METHOD_CONNECT
public static final java.lang.String WEBDAV_METHOD_PROPFIND
public static final java.lang.String WEBDAV_METHOD_PROPPATCH
public static final java.lang.String WEBDAV_METHOD_MKCOL
public static final java.lang.String WEBDAV_METHOD_COPY
public static final java.lang.String WEBDAV_METHOD_MOVE
public static final java.lang.String WEBDAV_METHOD_DELETE
public static final java.lang.String WEBDAV_METHOD_LOCK
public static final java.lang.String WEBDAV_METHOD_UNLOCK
public static final java.lang.String WEBDAV_METHOD_SEARCH
public static final java.lang.String WEBDAV_METHOD_VERSION_CONTROL
public static final java.lang.String WEBDAV_METHOD_BASELINE_CONTROL
public static final java.lang.String WEBDAV_METHOD_REPORT
public static final java.lang.String WEBDAV_METHOD_CHECKOUT
public static final java.lang.String WEBDAV_METHOD_CHECKIN
public static final java.lang.String WEBDAV_METHOD_UNCHECKOUT
public static final java.lang.String WEBDAV_METHOD_MKWORKSPACE
public static final java.lang.String WEBDAV_METHOD_MERGE
public static final java.lang.String WEBDAV_METHOD_UPDATE
public static final java.lang.String WEBDAV_METHOD_ACL
public static final int METHOD_PROP_RETRY
public static final int METHOD_PROP_REDIRECT
public static final int METHOD_PROP_SWITCH_TO_POST
public static final int METHOD_PROP_ADD_CL_HEADER
public static final int METHOD_PROP_IGNORE_RESPONSE_BODY
public static final int METHOD_PROP_REQ_LINE_URL
public static final int METHOD_PROP_REQ_LINE_STAR
public static final int METHOD_PROP_REQ_LINE_HOST_PORT
public static final int METHOD_PROP_CALCULATE_CONTENT_LEN
public static final int METHOD_PROP_SEND_CONTENT_TYPE
public static final int METHOD_PROP_LEAVE_OPEN
public static final int METHOD_PROP_SUPPORTS_TUNNELED
public static final int METHOD_PROP_UNSPECIFIED_METHOD
public static final int METHOD_PROP_UNKNOWN_METHOD
public static final int NTLM_ENCODING_UNICODE
public static final int NTLM_ENCODING_OEM
public static final int PIPE_NONE
public static final int PIPE_PIPELINE
public static final int PIPE_MAX_CONNECTIONS
public static final int PIPE_STANDARD_OPTIONS
public static final int AUTH_NORMAL
public static final int AUTH_PROXY
public static final int SOCKET_RECEIVE
public static final int SOCKET_SEND
public static final int DEFAULT_SEND_BUFFER_SIZE
public static final int DEFAULT_RECEIVE_BUFFER_SIZE
public static java.lang.String DEFAULT_USER_AGENT
public static int DEFAULT_MAX_CONNECTIONS
public static int MAX_TRIES
Constructor Detail |
public HttpURLConnection()
public HttpURLConnection(java.net.URL urlParam)
Method Detail |
public static HttpURLConnection openConnection(java.net.URL url)
URL.openConnection()
public void finalize()
public void setRequestMethod(java.lang.String meth)
HttpURLConnection.setRequestMethod(String)
public void setRequestProperty(java.lang.String key, java.lang.String value)
URLConnection.setRequestProperty(String,String)
public void addRequestProperty(java.lang.String key, java.lang.String value)
URLConnection.addRequestProperty(String,String)
public java.lang.String getRequestProperty(java.lang.String key)
URLConnection.getRequestProperty(String)
public final void setInstanceFollowRedirects(boolean followRedirects)
followRedirects
- true to follow redirects, false otherwisepublic final boolean getInstanceFollowRedirects()
public java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
URLConnection.getOutputStream()
public boolean usingProxy()
HttpURLConnection.usingProxy()
public void connect() throws java.io.IOException
java.io.IOException
URLConnection.connect()
public static HttpConnectionManager getConnectionManager()
public void setConnection(HttpConnection conn) throws java.io.IOException
The caller must ensure that the same HttpConnection object is not used by multiple HttpURLConnections.
java.io.IOException
- - if the connection cannot be opened
java.lang.IllegalStateException
- - if a connection has already been associated with this
object.public HttpConnection getConnection()
public boolean isConnected()
public int getResponseCode() throws java.io.IOException
java.io.IOException
HttpURLConnection.getResponseCode()
public java.lang.String getResponseMessage() throws java.io.IOException
java.io.IOException
HttpURLConnection.getResponseMessage()
public void setChunkedStreamingMode(int chunkLen)
This uses the HTTP chunked transfer encoding mode, which is an optional feature not supported by all HTTP servers.
Use this if:
Use of this method avoids double-copying of the data.
When using this method, you may not call write(int) method on the returned stream. If you must use single byte writes, then wrap the returned stream in a BufferedOutputStream(). The chunk size will then be the size of that buffer.
This is used to improve performance sending by not first buffering the data associated with the request. If the request requires authentication or redirection, this will not work as the data will have been sent. In this case, you will get an HttpRetryException
chunkLen
- - This is ignored and exists for compatibility with the Java
HttpURLConnection API. The size of each chunk is based on the
size of each write to the stream.
java.lang.IllegalStateException
- - If the connection is already connected or a different
streaming mode has been set.public void setFixedLengthStreamingMode(int fixedLen)
Use of this method avoids double-copying of the data.
This is used to improve performance sending by not first buffering the data associated with the request. If the request requires authentication or redirection, this will not work as the data will have been sent. In this case, you will get an HttpRetryException
fixedLen
- - The size of the data being sent (the Content-Length)
java.lang.IllegalStateException
- - If the connection is already connected or a different
streaming mode has been set.public void setRawStreamingMode(boolean useRaw)
When using this option, you get the OutputStream using
getOutputStream()
and then write the HTTP request that stream.
After the request is written close the stream. The HTTP response is
handled normally.
This is used if you wish to have complete control over the exact content of the HTTP request.
useRaw
- True if enabling raw streaming, false if not
java.lang.IllegalStateException
- - If the connection is already connected or a different
streaming mode has been set.public void setTunneledStreamingMode(boolean useTunneled)
When using this option, you get the OutputStream using
getOutputStream()
and then can write to the tunneled connection
as desired. You can also use getInputStream()
to read from the
tunneled connection.
When you are doing using the connection, simply close both the input and output streams.
useTunneled
- True if enabling tunneled streaming, false if not
java.lang.IllegalStateException
- - If the connection is already connected or a different
streaming mode has been set.public java.lang.String getHeaderField(java.lang.String name)
Before calling
this, you must call either getResponseCode() or getInputStream() to
read the response.
public java.util.Map getHeaderFields()
Before calling this, you
must call either getResponseCode() or getInputStream() to read the
response.
public java.lang.String getHeaderFieldKey(int keyPosition)
Before calling
this, you must call either getResponseCode() or getInputStream() to
read the response.
public java.lang.String getHeaderField(int position)
Before calling this,
you must call either getResponseCode() or getInputStream() to read
the response.
public int getHeadersLength()
public void setCookieSupport(CookieContainer container, java.lang.String policy)
container
- the container store/retrieve the cookies associated with this
request, null if the request should not used cookies.policy
- the name of the CookiePolicy to use in processing cookies. -1
will use the default policy, if the container is not null.public static void setDefaultCookieSupport(CookieContainer container, java.lang.String policy)
public CookieContainer getCookieContainer()
public java.lang.String getCookiePolicy()
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
URLConnection.getInputStream()
public java.io.Reader getReader() throws java.io.IOException
getInputStream()
, used if you
want to read the data as character data instead of as bytes. The
characters returned will be decoded according to the
Content-Encoding
and Content-Type
headers in
the response. If the charset of the response is not specified using a
Content-Type
header, then ISO-8859-1 is used, in accordance
with the rules of RFC 2616 (3.7.1).
java.io.IOException
public java.io.InputStream getErrorStream()
HttpURLConnection.getErrorStream()
public void disconnect()
HttpURLConnection.disconnect()
public static void setDefaultUserAgent(HttpUserAgent userAgent)
public static HttpUserAgent getDefaultUserAgent()
public void setUserAgent(HttpUserAgent userAgent)
userAgent
- a object that implements the HttpUserAgent interface.HttpUserAgent
public HttpUserAgent getUserAgent()
HttpUserAgent
public boolean getDoAuthentication()
public void setDoAuthentication(boolean doAuthentication)
The default is true.
doAuthentication
- true to process authenticationspublic int getTimeout()
public void setTimeout(int ms)
ms
- milliseconds to wait for a connection or response.public int getConnectionTimeout()
public void setConnectionTimeout(int ms)
ms
- milliseconds to wait for the socket connection.public int getRequestTimeout()
public void setRequestTimeout(int ms)
ms
- milliseconds to wait for the response.public static int getDefaultTimeout()
public static void setDefaultTimeout(int ms)
com.oaklandsw.http.timeout
property. This is the same as
calling setDefaultConnectTimeout() and setDefaultRequestTimeout() with
the same value.
ms
- milliseconds to wait for a connection or response.public static int getDefaultConnectionTimeout()
public static void setDefaultConnectionTimeout(int ms)
ms
- milliseconds to wait for a socket connection.public static int getDefaultRequestTimeout()
public static void setDefaultRequestTimeout(int ms)
ms
- milliseconds to wait for a response.public int getIdleConnectionTimeout()
public void setIdleConnectionTimeout(int ms)
ms
- milliseconds to wait before closing an idle connection.public static int getDefaultIdleConnectionTimeout()
public static void setDefaultIdleConnectionTimeout(int ms)
com.oaklandsw.http.idleConnectionTimeout
property.
ms
- milliseconds to wait before closing an idle connection.public static void setDefaultIdleConnectionTimeout()
public int getIdleConnectionPing()
public void setIdleConnectionPing(int ms)
ms
- milliseconds to wait before pinging an idle connection.public static int getDefaultIdleConnectionPing()
public static void setDefaultIdleConnectionPing(int ms)
com.oaklandsw.http.idleConnectionPing
property.
ms
- milliseconds to wait before pinging an idle connection.public static void setDefaultIdleConnectionPing()
public int getConnectionRequestLimit()
setConnectionRequestLimit(int)
public void setConnectionRequestLimit(int requests)
This is useful in certain pipelining situations where the connection might be closed by the server after a certain number of requests. However, if the server closes a connection after a certain number of requests using a Connection-Close header, this fact is automatically noted and pipelining will not send more than that observed number of requests on a socket connection.
requests
- number of requests allowed for each underlying socket
connectionpublic static int getDefaultConnectionRequestLimit()
public static void setDefaultConnectionRequestLimit(int requests)
com.oaklandsw.http.connectionRequestLimit
property.
requests
- number of requests allowed for each underlying socket
connectionpublic static void setDefaultConnectionRequestLimit()
public static boolean isExplicitClose()
public static void setExplicitClose(boolean explicitClose)
explicitClose
- the value for explicit closing of the connection.public static void setMaxConnectionsPerHost(int maxConnections)
Note that this refers to the connections to the target host of the request, it does not refer to the maximum number of connections to a proxy server. The maximum number of connections to a proxy server is always unlimited.
maxConnections
- a number of connections allowed for each host:port, specify -1
for an unlimited number of connections.public static int getMaxConnectionsPerHost()
public static void setUse10KeepAlive(boolean use)
use
- true if HTTP 1.0 Keep-Alive headers are includedpublic static boolean getUse10KeepAlive()
public static void setTries(int tries)
tries
- the number of times to try the request.public static void setDefaultMaxTries(int tries) throws java.lang.IllegalArgumentException
tries
- the number of times to try the request.
java.lang.IllegalArgumentException
public static int getTries()
public static int getDefaultMaxTries()
public static void setDefaultMaxForwards(int forwards) throws java.lang.IllegalArgumentException
forwards
- the number of times to redirect or retry authentication
java.lang.IllegalArgumentException
public static int getDefaultMaxForwards()
public static void setRetryInterval(int ms)
ms
- the interval to wait in milliseconds.public static int getRetryInterval()
public static void setPreemptiveAuthentication(boolean enabled)
This is by default disabled.
enabled
- true if enabledpublic static boolean getPreemptiveAuthentication()
public static void setDefaultAuthenticationType(int type)
The value of the authentication type is one of the values in the Credential class (NTLM, BASIC, DIGEST).
type
- an integer, the default authentication type.setAuthenticationType(int)
public static int getDefaultAuthenticationType()
getAuthenticationType()
public int getAuthenticationType()
setAuthenticationType(int)
public void setAuthenticationType(int authenticationType)
When using pipelining with authentication, you must specify an authentication type. When using streaming with authentication, you may specify the authentication type to avoid a HttpRetryException. In either case, specifying an authentication type forces the authentication process to complete for the request (Basic or Digest) or connection (NTLM) before the pipelining or streaming starts.
Authentication behaves as follows:
authenticationType
- setPipelining(boolean)
,
setChunkedStreamingMode(int)
,
setFixedLengthStreamingMode(int)
public static void setDefaultProxyAuthenticationType(int type)
The value of the authentication type is one of the values in the Credential class (NTLM, BASIC, DIGEST).
type
- an integer, the default proxy authentication type.setProxyAuthenticationType(int)
public static int getDefaultProxyAuthenticationType()
getProxyAuthenticationType()
public int getProxyAuthenticationType()
setProxyAuthenticationType(int)
public void setProxyAuthenticationType(int authenticationType)
Same as setAuthenticationType, except for a proxy.
authenticationType
- setAuthenticationType(int)
public java.lang.String getAuthenticationDummyContent()
public void setAuthenticationDummyContent(java.lang.String authenticationDummyContent)
public java.lang.String getAuthenticationDummyMethod()
public void setAuthenticationDummyMethod(java.lang.String authenticationDummyMethod)
public static void setDefaultPipelining(boolean enabled)
This is by default disabled.
enabled
- true if enabledpublic static boolean isDefaultPipelining()
public static void setDefaultPipeliningOptions(int pipeliningOptions)
pipeliningOptions
- - see the PIPE_ constants.public static int getDefaultPipeliningOptions()
public void setPipelining(boolean enabled)
By default, the following pipeline options are set: PIPE_PIPELINE and PIPE_MAX_CONNECTIONS.
enabled
- true if enabled for this connectionpublic boolean isPipelining()
public static java.lang.String plOptionsToString(int options)
options
-
public void setPipeliningOptions(int pipeliningOptions)
pipeliningOptions
- - see the PIPE_ constants.public int getPipeliningOptions()
public static void setDefaultPipeliningMaxDepth(int pipeliningMaxDepth)
pipeliningMaxDepth
- the maximum pipelining depth.setPipeliningMaxDepth(int)
public static int getDefaultPipeliningMaxDepth()
public void setPipeliningMaxDepth(int pipeliningMaxDepth)
The maximum depth is the number of outstanding HTTP requests that can be active at any one time on a socket connection. If this is 0 then there is no limit. Note that most of the time this is not necessary, as the pipelining mechanism automatically senses the maximum number of HTTP requests allowed on a socket connection before that connection is closed by the server and uses this as the maximum depth. See PIPE_USE_OBSERVED_CONN_LIMIT.
pipeliningMaxDepth
- the maximum pipelining depth.public int getPipeliningMaxDepth()
public static void setDefaultCallback(Callback cb)
Callback objects are used to handle notifications related to pipelining or non-blocking I/O.
cb
- a Callback object.public static Callback getDefaultCallback()
public void setCallback(Callback cb)
Callback objects are used to handle notifications related to pipelining or non-blocking I/O.
cb
- public Callback getCallback()
public void pipelineExecute() throws java.lang.InterruptedException, java.io.InterruptedIOException
pipelineBlock()
to wait for all of the
pipelined connections you have executed on this thread.
java.lang.InterruptedException
java.io.InterruptedIOException
public static void pipelineBlock() throws java.lang.InterruptedException
java.lang.InterruptedException
public void pipelineExecuteAsync() throws java.lang.InterruptedException
This will never block for any reason; it moves the work of writing the HTTP request to another thread.
java.lang.InterruptedException
public static void setProxyHost(java.lang.String host)
Note that when this is called, all existing connections are closed, since the existing connections are no longer going to the desired destination.
host
- the name of the host to be used as a proxy server.public static java.lang.String getProxyHost()
public static void setProxySsl(boolean ssl)
Note that when this is called, all existing connections are closed, since the existing connections are no longer going to the desired destination.
ssl
- true if the proxy is to use SSL.public static boolean isProxySsl()
public void setConnectionProxyHost(java.lang.String host)
This must be called before the connection is connected.
host
- the name of the host to be used as a proxy server.public java.lang.String getConnectionProxyHost()
public void setConnectionProxySsl(boolean ssl)
This must be called before the connection is connected.
ssl
- true if the proxy is to use SSL.public boolean isConnectionProxySsl()
public static void setProxyPort(int port)
Note that when this is called, all existing connections are closed, since the existing connections are no longer going to the desired destination.
port
- the port number of the proxy server.public static int getProxyPort()
public void setConnectionProxyPort(int port)
This must be called before the connection is connected.
port
- the port number of the proxy server.public int getConnectionProxyPort()
public static void setProxyUser(java.lang.String user)
This is used only if no HTTPUserAgent is provided.
user
- the name of the user to be used with the proxy server.public static java.lang.String getProxyUser()
public void setConnectionProxyUser(java.lang.String user)
This is used only if no HTTPUserAgent is provided.
This must be called before the connection is connected.
user
- the name of the host to be used as a proxy server.public java.lang.String getConnectionProxyUser()
public static void setProxyPassword(java.lang.String password)
This is used only if no HTTPUserAgent is provided.
This must be called before the connection is connected.
password
- the name of the password to be used with the proxy server.public static java.lang.String getProxyPassword()
public void setConnectionProxyPassword(java.lang.String password)
This is used only if no HTTPUserAgent is provided.
This must be called before the connection is connected.
password
- the name of the host to be used as a proxy server.public java.lang.String getConnectionProxyPassword()
public static void setNonProxyHosts(java.lang.String hosts)
setProxyHost(String)
method.
This does not apply if you set the proxy host on the connection
directly using setConnectionProxyHost(String)
. This allows you
to override the proxy setting for a connection without regard to the
setting of the global non-proxy hosts.
hosts
- a list of hosts separated by the pipe ("|")
character. Each host is a string containing either a hostname
or IP address. The "*" character may be used within this
string to provide wildcarding.isNonProxyHost(String)
public static java.lang.String getNonProxyHosts()
public static boolean isNonProxyHost(java.lang.String hostName)
public static boolean getMultiCredentialsPerAddress()
public static void setMultiCredentialsPerAddress(boolean multi)
multi
- true if multiple sets of credentials are allowedpublic static void resetCachedCredentials()
Used only when getMulti[Proxy]CredentialsPerAddress is false as this is the only time the credentials are cached. Note that when getMulti[Proxy]CredentialsPerAddress is specified, there is no matching of the (proxy) credentials to the credentials on which the underlying socket connections were created. So if you reset the cache here and then use different credentials, any existing socket connections in the pool may be used with their original credentials. To avoid this, call closeAllPooledConnections().
getMultiCredentialsPerAddress()
,
setMultiCredentialsPerAddress(boolean)
public static void closeAllPooledConnections() throws java.lang.InterruptedException
HTTP requests that are currently in progress will be allowed complete normally. The connections associated with those requests will be closed when the connections complete.
java.lang.InterruptedException
public static void immediateShutdown() throws java.lang.InterruptedException
java.lang.InterruptedException
public static void resetStatistics()
public static java.lang.String dumpAll()
public static void dumpAll(java.io.PrintWriter out)
public static java.lang.String getConnectionPool()
public static java.lang.String getStatistics()
public static java.lang.String getStaticConfiguration()
public java.lang.String getCipherSuite()
public java.security.cert.Certificate[] getLocalCertificates()
public java.security.cert.Certificate[] getServerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException
javax.net.ssl.SSLPeerUnverifiedException
public static HostnameVerifier getDefaultHostnameVerifier()
public static void setDefaultHostnameVerifier(HostnameVerifier verifier)
public HostnameVerifier getHostnameVerifier()
public void setHostnameVerifier(HostnameVerifier verifier)
public static javax.net.ssl.SSLSocketFactory getDefaultSSLSocketFactory()
public static void setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory factory)
public javax.net.ssl.SSLSocketFactory getSSLSocketFactory()
public void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory factory)
public boolean isForceSSL()
public void setForceSSL(boolean forceSSL)
public static boolean isDefaultForceSSL()
public static void setDefaultForceSSL(boolean forceSSL)
public static AbstractSocketFactory getDefaultSocketFactory()
public static void setDefaultSocketFactory(AbstractSocketFactory factory)
public AbstractSocketFactory getSocketFactory()
public void setSocketFactory(AbstractSocketFactory factory)
public static void setSocketBufferSize(int type, int size)
type
- specify either SOCKET_READ or SOCKET_WRITE.size
- the buffer size in bytes. Specify -1 to use the default system
setting for the buffer size. The defaults are found in the
constants DEFAULT_SEND_BUFFER_SIZE
and
DEFAULT_RECEIVE_BUFFER_SIZE
.public static int getSocketBufferSize(int type)
type
- specify either SOCKET_READ or SOCKET_WRITE.
public static void setNtlmPreferredEncoding(int encoding)
public static int getNtlmPreferredEncoding()
public static void setMethodProperties(java.lang.String methodName, int properties)
methodName
- the name of the method, like GET or POSTproperties
- the property value which is one or more (union) of the
constants beginning METHOD_PROP_public static void setDefaultThrowFileNotFoundOn404(boolean doThrow)
doThrow
- true if a FileNotFoundException is to be thrown.public static boolean getDefaultThrowFileNotFoundOn404()
public java.lang.String getUrlString()
public java.lang.String toString()
public static void resetUrlConReleased()
public static void resetGlobalState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |