com.oaklandsw.http
Class HttpURLConnection

java.lang.Object
  extended byjava.net.URLConnection
      extended byjava.net.HttpURLConnection
          extended bycom.oaklandsw.http.HttpURLConnection

public abstract class HttpURLConnection
extends java.net.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

HTTP_METHOD_GET

public static final java.lang.String HTTP_METHOD_GET
See Also:
Constant Field Values

HTTP_METHOD_POST

public static final java.lang.String HTTP_METHOD_POST
See Also:
Constant Field Values

HTTP_METHOD_PUT

public static final java.lang.String HTTP_METHOD_PUT
See Also:
Constant Field Values

HTTP_METHOD_OPTIONS

public static final java.lang.String HTTP_METHOD_OPTIONS
See Also:
Constant Field Values

HTTP_METHOD_DELETE

public static final java.lang.String HTTP_METHOD_DELETE
See Also:
Constant Field Values

HTTP_METHOD_HEAD

public static final java.lang.String HTTP_METHOD_HEAD
See Also:
Constant Field Values

HTTP_METHOD_TRACE

public static final java.lang.String HTTP_METHOD_TRACE
See Also:
Constant Field Values

HTTP_METHOD_CONNECT

public static final java.lang.String HTTP_METHOD_CONNECT
See Also:
Constant Field Values

WEBDAV_METHOD_PROPFIND

public static final java.lang.String WEBDAV_METHOD_PROPFIND
See Also:
Constant Field Values

WEBDAV_METHOD_PROPPATCH

public static final java.lang.String WEBDAV_METHOD_PROPPATCH
See Also:
Constant Field Values

WEBDAV_METHOD_MKCOL

public static final java.lang.String WEBDAV_METHOD_MKCOL
See Also:
Constant Field Values

WEBDAV_METHOD_COPY

public static final java.lang.String WEBDAV_METHOD_COPY
See Also:
Constant Field Values

WEBDAV_METHOD_MOVE

public static final java.lang.String WEBDAV_METHOD_MOVE
See Also:
Constant Field Values

WEBDAV_METHOD_DELETE

public static final java.lang.String WEBDAV_METHOD_DELETE
See Also:
Constant Field Values

WEBDAV_METHOD_LOCK

public static final java.lang.String WEBDAV_METHOD_LOCK
See Also:
Constant Field Values

WEBDAV_METHOD_UNLOCK

public static final java.lang.String WEBDAV_METHOD_UNLOCK
See Also:
Constant Field Values

WEBDAV_METHOD_SEARCH

public static final java.lang.String WEBDAV_METHOD_SEARCH
See Also:
Constant Field Values

WEBDAV_METHOD_VERSION_CONTROL

public static final java.lang.String WEBDAV_METHOD_VERSION_CONTROL
See Also:
Constant Field Values

WEBDAV_METHOD_BASELINE_CONTROL

public static final java.lang.String WEBDAV_METHOD_BASELINE_CONTROL
See Also:
Constant Field Values

WEBDAV_METHOD_REPORT

public static final java.lang.String WEBDAV_METHOD_REPORT
See Also:
Constant Field Values

WEBDAV_METHOD_CHECKOUT

public static final java.lang.String WEBDAV_METHOD_CHECKOUT
See Also:
Constant Field Values

WEBDAV_METHOD_CHECKIN

public static final java.lang.String WEBDAV_METHOD_CHECKIN
See Also:
Constant Field Values

WEBDAV_METHOD_UNCHECKOUT

public static final java.lang.String WEBDAV_METHOD_UNCHECKOUT
See Also:
Constant Field Values

WEBDAV_METHOD_MKWORKSPACE

public static final java.lang.String WEBDAV_METHOD_MKWORKSPACE
See Also:
Constant Field Values

WEBDAV_METHOD_MERGE

public static final java.lang.String WEBDAV_METHOD_MERGE
See Also:
Constant Field Values

WEBDAV_METHOD_UPDATE

public static final java.lang.String WEBDAV_METHOD_UPDATE
See Also:
Constant Field Values

WEBDAV_METHOD_ACL

public static final java.lang.String WEBDAV_METHOD_ACL
See Also:
Constant Field Values

METHOD_PROP_RETRY

public static final int METHOD_PROP_RETRY
This method will be retried automatically.

See Also:
Constant Field Values

METHOD_PROP_REDIRECT

public static final int METHOD_PROP_REDIRECT
This method will follow redirects.

See Also:
Constant Field Values

METHOD_PROP_SWITCH_TO_POST

public static final int METHOD_PROP_SWITCH_TO_POST
This is used for an HTTP GET method. If a GET method was specified, and getOutputStream() is subsequently called, this changes the method to a POST method. This is for JDK compatibility.

See Also:
Constant Field Values

METHOD_PROP_ADD_CL_HEADER

public static final int METHOD_PROP_ADD_CL_HEADER
Add the content-length header if not already specified. Used for the POST and PUT methods.

See Also:
Constant Field Values

METHOD_PROP_IGNORE_RESPONSE_BODY

public static final int METHOD_PROP_IGNORE_RESPONSE_BODY
The response body is ignored. Used for the HEAD method.

See Also:
Constant Field Values

METHOD_PROP_REQ_LINE_URL

public static final int METHOD_PROP_REQ_LINE_URL
The request line has a URL (most HTTP methods)

See Also:
Constant Field Values

METHOD_PROP_REQ_LINE_STAR

public static final int METHOD_PROP_REQ_LINE_STAR
The request line consists of only a "*" (for OPTIONS)

See Also:
Constant Field Values

METHOD_PROP_REQ_LINE_HOST_PORT

public static final int METHOD_PROP_REQ_LINE_HOST_PORT
The request line has only the host/port (CONNECT)

See Also:
Constant Field Values

METHOD_PROP_CALCULATE_CONTENT_LEN

public static final int METHOD_PROP_CALCULATE_CONTENT_LEN
The content length value is calculated (for potentially adding a content-length header) (POST/PUT).

See Also:
Constant Field Values

METHOD_PROP_SEND_CONTENT_TYPE

public static final int METHOD_PROP_SEND_CONTENT_TYPE
A content-type header is automatically added (PUT). This is only used is the METHOD_PROP_CALCULATE_CONTENT_LEN is also set.

See Also:
Constant Field Values

METHOD_PROP_LEAVE_OPEN

public static final int METHOD_PROP_LEAVE_OPEN
The connection is left open for this method (CONNECT)

See Also:
Constant Field Values

METHOD_PROP_SUPPORTS_TUNNELED

public static final int METHOD_PROP_SUPPORTS_TUNNELED
This method supports the tunneling streaming mode (CONNECT)

See Also:
Constant Field Values

METHOD_PROP_UNSPECIFIED_METHOD

public static final int METHOD_PROP_UNSPECIFIED_METHOD
This is what the method properties are set to initially, this value indicates no method was specified. If this is the case, then the GET method is assumed.

See Also:
Constant Field Values

METHOD_PROP_UNKNOWN_METHOD

public static final int METHOD_PROP_UNKNOWN_METHOD
A method was specified, but is not known (in the table of methods)

See Also:
Constant Field Values

NTLM_ENCODING_UNICODE

public static final int NTLM_ENCODING_UNICODE
See Also:
Constant Field Values

NTLM_ENCODING_OEM

public static f