| Modifier and Type | Field and Description |
|---|---|
| private final DelegateHttpsURLConnection |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addRequestProperty(String
the keyword by which the request is known
(e.g., " key, String accept").the value associated with it. value)Overrides java. Adds a general request property specified by a key-value pair. |
| pack-priv static URL | |
| public void | connect()
Implements abstract java. Implements the HTTP protocol handler's "connect" method, establishing an SSL connection to the server as necessary. |
| public void | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public boolean | getAllowUserInteraction()
Overrides java. Returns the value of the |
| public String | getCipherSuite()
Implements abstract javax. Returns the cipher suite in use on this connection. |
| public int | getConnectTimeout()
Overrides java. Returns setting for connect timeout. |
| public Object | getContent()
Overrides java. Retrieves the contents of this URL connection. |
| public Object | getContent(Class<T>[] classes)
Overrides java. Retrieves the contents of this URL connection. |
| public String | getContentEncoding()
Overrides java. Returns the value of the |
| public int | getContentLength()
Overrides java. Returns the value of the |
| public long | getContentLengthLong()
Overrides java. Returns the value of the |
| public String | getContentType()
Overrides java. Returns the value of the |
| public long | |
| public boolean | getDefaultUseCaches()
Overrides java. Returns the default value of a |
| public boolean | getDoInput()
Overrides java. Returns the value of this |
| public boolean | getDoOutput()
Overrides java. Returns the value of this |
| public InputStream | getErrorStream()
Overrides java. Returns the error stream if the connection failed but the server sent useful data nonetheless. |
| public long | getExpiration()
Overrides java. Returns the value of the |
| public String | getHeaderField(String
the name of the header field name)Overrides java. Gets a header field by name. |
| public String | getHeaderField(int
the index of the header field n)Overrides java. Gets a header field by index. |
| public long | getHeaderFieldDate(String name, long defaultValue)
Overrides java. Returns the value of the named field parsed as date. |
| public int | getHeaderFieldInt(String name, int defaultValue)
Overrides java. Returns the value of the named field parsed as a number. |
| public String | getHeaderFieldKey(int
the index of the header field n)Overrides java. Gets a header field by index. |
| public long | getHeaderFieldLong(String name, long defaultValue)
Overrides java. Returns the value of the named field parsed as a number. |
| public Map | Returns: a Map of header fieldsOverrides java. Returns an unmodifiable Map of the header fields. |
| public long | getIfModifiedSince()
Overrides java. Returns the value of this object's |
| public InputStream | getInputStream()
Overrides java. Returns an input stream that reads from this open connection. |
| public boolean | getInstanceFollowRedirects()
Overrides java. Returns the value of this |
| public long | getLastModified()
Overrides java. Returns the value of the |
| public Certificate[] | getLocalCertificates()
Implements abstract javax. Returns the certificate chain the client sent to the server, or null if the client did not authenticate. |
| public Principal | getLocalPrincipal()
Overrides javax. Returns the principal the client sent to the server, or null if the client did not authenticate. |
| public OutputStream | getOutputStream()
Overrides java. Returns an output stream that writes to this connection. |
| public Principal | getPeerPrincipal()
Overrides javax. Returns the principal with which the server authenticated itself, or throw a SSLPeerUnverifiedException if the server did not authenticate. |
| public Permission | getPermission()
Overrides java.
Deprecated
for removal since 25.
Returns a |
| public int | |
| public String | |
| public Map | Returns: a Map of the general request properties for this connection.Overrides java. Returns an unmodifiable Map of general request properties for this connection. |
| public String | getRequestProperty(String key)
Overrides java. Returns the value of the named general request property for this connection. |
| public int | |
| public String | getResponseMessage()
Overrides java. Gets the HTTP response message, if any, returned along with the response code from a server. |
| public Certificate[] | getServerCertificates()
Implements abstract javax. Returns the server's certificate chain, or throws SSLPeerUnverified Exception if the server did not authenticate. |
| public Optional | getSSLSession()
Overrides javax. Returns an |
| public URL | getURL()
Overrides java. Returns the value of this |
| public boolean | getUseCaches()
Overrides java. Returns the value of this |
| public int | |
| protected boolean | |
| public void | setAllowUserInteraction(boolean allowuserinteraction)
Overrides java. Set the value of the |
| public void | setAuthenticator(Authenticator auth)
Overrides java. Supplies an |
| public void | setChunkedStreamingMode(int chunklen)
Overrides java. This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is not known in advance. |
| protected void | |
| public void | setConnectTimeout(int timeout)
Overrides java. Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the resource referenced by this URLConnection. |
| public void | setDefaultUseCaches(boolean defaultusecaches)
Overrides java. Sets the default value of the |
| public void | setDoInput(boolean doinput)
Overrides java. Sets the value of the |
| public void | setDoOutput(boolean dooutput)
Overrides java. Sets the value of the |
| public void | setFixedLengthStreamingMode(int contentLength)
Overrides java. This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is known in advance. |
| public void | setFixedLengthStreamingMode(long contentLength)
Overrides java. This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is known in advance. |
| public void | setIfModifiedSince(long ifmodifiedsince)
Overrides java. Sets the value of the |
| public void | setInstanceFollowRedirects(boolean shouldFollow)
Overrides java. Sets whether HTTP redirects (requests with response code 3xx) should
be automatically followed by this |
| protected void | setNewClient(URL
the URL being accessed url)Create a new HttpClient object, bypassing the cache of HTTP client objects/connections. |
| protected void | setNewClient(URL
the URL being accessed url, boolean whether the cached connection should be used
if present useCache)Obtain a HttpClient object. |
| protected void | setProxiedClient(URL
the URL being accessed url, String the proxy host to use proxyHost, int the proxy port to use proxyPort)Create a new HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy. |
| protected void | setProxiedClient(URL
the URL being accessed url, String the proxy host to use proxyHost, int the proxy port to use proxyPort, boolean whether the cached connection should be used
if present useCache)Obtain a HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy. |
| public void | setReadTimeout(int timeout)
Overrides java. Sets the read timeout to a specified timeout, in milliseconds. |
| public void | setRequestMethod(String method)
Overrides java. Set the method for the URL request, one of:
|
| public void | setRequestProperty(String key, String
the value to be set value)Overrides java. Sets request property. |
| public void | setUseCaches(boolean usecaches)
Overrides java. Sets the value of the |
| public String | toString()
Overrides java. Returns a |
| public boolean | usingProxy()
Implements abstract java. Indicates if the connection is going through a proxy. |
| delegate | back to summary |
|---|---|
| private final DelegateHttpsURLConnection delegate | |
| HttpsURLConnectionImpl | back to summary |
|---|---|
| pack-priv HttpsURLConnectionImpl(URL u, Handler handler) throws IOException | |
| HttpsURLConnectionImpl | back to summary |
|---|---|
| pack-priv HttpsURLConnectionImpl(URL u, Proxy p, Handler handler) throws IOException | |
| addRequestProperty | back to summary |
|---|---|
| public void addRequestProperty(String key, String value) Overrides java. Adds a general request property specified by a key-value pair. This method will not overwrite existing values associated with the same key.
| |
| checkURL | back to summary |
|---|---|
| pack-priv static URL checkURL(URL u) throws IOException | |
| connect | back to summary |
|---|---|
| public void connect() throws IOException Implements abstract java. Implements the HTTP protocol handler's "connect" method, establishing an SSL connection to the server as necessary.
| |
| disconnect | back to summary |
|---|---|
| public void disconnect() Implements abstract java. Disconnect from the server. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getAllowUserInteraction | back to summary |
|---|---|
| public boolean getAllowUserInteraction() Overrides java. Doc from java. Returns the value of the | |
| getCipherSuite | back to summary |
|---|---|
| public String getCipherSuite() Implements abstract javax. Returns the cipher suite in use on this connection. | |
| getConnectTimeout | back to summary |
|---|---|
| public int getConnectTimeout() Overrides java. Doc from java. Returns setting for connect timeout. 0 return implies that the option is disabled (i.e., timeout of infinity). | |
| getContent | back to summary |
|---|---|
| public Object getContent() throws IOException Overrides java. Doc from java. Retrieves the contents of this URL connection.
This method first determines the content type of the object by
calling the This is done as follows:
| |
| getContent | back to summary |
|---|---|
| public Object getContent(Class<T>[] classes) throws IOException Overrides java. Doc from java. Retrieves the contents of this URL connection.
| |
| getContentEncoding | back to summary |
|---|---|
| public String getContentEncoding() Overrides java. Doc from java. Returns the value of the | |
| getContentLength | back to summary |
|---|---|
| public int getContentLength() Overrides java. Doc from java. Returns the value of the Note
| |
| getContentLengthLong | back to summary |
|---|---|
| public long getContentLengthLong() Overrides java. Doc from java. Returns the value of the | |
| getContentType | back to summary |
|---|---|
| public String getContentType() Overrides java. Doc from java. Returns the value of the | |
| getDate | back to summary |
|---|---|
| public long getDate() Overrides java. Doc from java. Returns the value of the | |
| getDefaultUseCaches | back to summary |
|---|---|
| public boolean getDefaultUseCaches() Overrides java. Doc from java. Returns the default value of a
This default is "sticky", being a part of the static state of all
URLConnections. This flag applies to the next, and all following
URLConnections that are created. This default value can be over-ridden
per protocol using | |
| getDoInput | back to summary |
|---|---|
| public boolean getDoInput() Overrides java. Doc from java. Returns the value of this | |
| getDoOutput | back to summary |
|---|---|
| public boolean getDoOutput() Overrides java. Doc from java. Returns the value of this | |
| getErrorStream | back to summary |
|---|---|
| public InputStream getErrorStream() Overrides java. Doc from java. Returns the error stream if the connection failed but the server sent useful data nonetheless. The typical example is when an HTTP server responds with a 404, which will cause a FileNotFoundException to be thrown in connect, but the server sent an HTML help page with suggestions as to what to do. This method will not cause a connection to be initiated. If the connection was not connected, or if the server did not have an error while connecting or if the server had an error but no error data was sent, this method will return null. This is the default. | |
| getExpiration | back to summary |
|---|---|
| public long getExpiration() Overrides java. Doc from java. Returns the value of the | |
| getHeaderField | back to summary |
|---|---|
| public String getHeaderField(String name) Overrides java. Gets a header field by name. Returns null if not known.
| |
| getHeaderField | back to summary |
|---|---|
| public String getHeaderField(int n) Overrides java. Gets a header field by index. Returns null if not known.
| |
| getHeaderFieldDate | back to summary |
|---|---|
| public long getHeaderFieldDate(String name, long defaultValue) Overrides java. Doc from java. Returns the value of the named field parsed as date. The result is the number of milliseconds since January 1, 1970 GMT represented by the named field.
This form of | |
| getHeaderFieldInt | back to summary |
|---|---|
| public int getHeaderFieldInt(String name, int defaultValue) Overrides java. Doc from java. Returns the value of the named field parsed as a number.
This form of | |
| getHeaderFieldKey | back to summary |
|---|---|
| public String getHeaderFieldKey(int n) Overrides java. Gets a header field by index. Returns null if not known.
| |
| getHeaderFieldLong | back to summary |
|---|---|
| public long getHeaderFieldLong(String name, long defaultValue) Overrides java. Doc from java. Returns the value of the named field parsed as a number.
This form of | |
| getHeaderFields | back to summary |
|---|---|
| public Map Overrides java. Returns an unmodifiable Map of the header fields. The Map keys are Strings that represent the response-header field names. Each Map value is an unmodifiable List of Strings that represents the corresponding field values. | |
| getIfModifiedSince | back to summary |
|---|---|
| public long getIfModifiedSince() Overrides java. Doc from java. Returns the value of this object's | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Overrides java. Doc from java. Returns an input stream that reads from this open connection. A SocketTimeoutException can be thrown when reading from the returned input stream if the read timeout expires before data is available for read.
| |
| getInstanceFollowRedirects | back to summary |
|---|---|
| public boolean getInstanceFollowRedirects() Overrides java. Doc from java. Returns the value of this | |
| getLastModified | back to summary |
|---|---|
| public long getLastModified() Overrides java. Doc from java. Returns the value of the | |
| getLocalCertificates | back to summary |
|---|---|
| public Certificate[] getLocalCertificates() Implements abstract javax. Returns the certificate chain the client sent to the server, or null if the client did not authenticate. | |
| getLocalPrincipal | back to summary |
|---|---|
| public Principal getLocalPrincipal() Overrides javax. Returns the principal the client sent to the server, or null if the client did not authenticate. | |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() throws IOException Overrides java. Doc from java. Returns an output stream that writes to this connection.
| |
| getPeerPrincipal | back to summary |
|---|---|
| public Principal getPeerPrincipal() throws SSLPeerUnverifiedException Overrides javax. Returns the principal with which the server authenticated itself, or throw a SSLPeerUnverifiedException if the server did not authenticate.
| |
| getPermission | back to summary |
|---|---|
| public Permission getPermission() throws IOException Overrides java. Doc from java. Deprecated for removal since 25. Returns a
| |
| getReadTimeout | back to summary |
|---|---|
| public int getReadTimeout() Overrides java. Doc from java. Returns setting for read timeout. 0 return implies that the option is disabled (i.e., timeout of infinity). | |
| getRequestMethod | back to summary |
|---|---|
| public String getRequestMethod() Overrides java. Doc from java. Get the request method. | |
| getRequestProperties | back to summary |
|---|---|
| public Map Overrides java. Returns an unmodifiable Map of general request properties for this connection. The Map keys are Strings that represent the request-header field names. Each Map value is a unmodifiable List of Strings that represents the corresponding field values.
| |
| getRequestProperty | back to summary |
|---|---|
| public String getRequestProperty(String key) Overrides java. Doc from java. Returns the value of the named general request property for this connection. | |
| getResponseCode | back to summary |
|---|---|
| public int getResponseCode() throws IOException Overrides java. Overwrite super class method
| |
| getResponseMessage | back to summary |
|---|---|
| public String getResponseMessage() throws IOException Overrides java. Doc from java. Gets the HTTP response message, if any, returned along with the response code from a server. From responses like: HTTP/1.0 200 OK HTTP/1.0 404 Not FoundExtracts the Strings "OK" and "Not Found" respectively. Returns null if none could be discerned from the responses (the result was not valid HTTP).
| |
| getServerCertificates | back to summary |
|---|---|
| public Certificate[] getServerCertificates() throws SSLPeerUnverifiedException Implements abstract javax. Returns the server's certificate chain, or throws SSLPeerUnverified Exception if the server did not authenticate.
| |
| getSSLSession | back to summary |
|---|---|
| public Optional Overrides javax. Doc from javax. Returns an
| |
| getURL | back to summary |
|---|---|
| public URL getURL() Overrides java. Doc from java. Returns the value of this | |
| getUseCaches | back to summary |
|---|---|
| public boolean getUseCaches() Overrides java. Doc from java. Returns the value of this | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isConnected | back to summary |
|---|---|
| protected boolean isConnected() Used by subclass to access "connected" variable. Since we are delegating the actual implementation to "delegate", we need to delegate the access of "connected" as well. | |
| setAllowUserInteraction | back to summary |
|---|---|
| public void setAllowUserInteraction(boolean allowuserinteraction) Overrides java. Doc from java. Set the value of the | |
| setAuthenticator | back to summary |
|---|---|
| public void setAuthenticator(Authenticator auth) Overrides java. Doc from java. Supplies an
| |
| setChunkedStreamingMode | back to summary |
|---|---|
| public void setChunkedStreamingMode(int chunklen) Overrides java. Doc from java. This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is not known in advance. In this mode, chunked transfer encoding is used to send the request body. Note, not all HTTP servers support this mode. When output streaming is enabled, authentication and redirection cannot be handled automatically. A HttpRetryException will be thrown when reading the response if authentication or redirection are required. This exception can be queried for the details of the error. This method must be called before the URLConnection is connected. | |
| setConnected | back to summary |
|---|---|
| protected void setConnected(boolean conn) Used by subclass to access "connected" variable. Since we are delegating the actual implementation to "delegate", we need to delegate the access of "connected" as well. | |
| setConnectTimeout | back to summary |
|---|---|
| public void setConnectTimeout(int timeout) Overrides java. Doc from java. Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the resource referenced by this URLConnection. If the timeout expires before the connection can be established, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout. Some non-standard implementation of this method may ignore the specified timeout. To see the connect timeout set, please call getConnectTimeout(). | |
| setDefaultUseCaches | back to summary |
|---|---|
| public void setDefaultUseCaches(boolean defaultusecaches) Overrides java. Doc from java. Sets the default value of the | |
| setDoInput | back to summary |
|---|---|
| public void setDoInput(boolean doinput) Overrides java. Doc from java. Sets the value of the A URL connection can be used for input and/or output. Set the doInput flag to true if you intend to use the URL connection for input, false if not. The default is true. | |
| setDoOutput | back to summary |
|---|---|
| public void setDoOutput(boolean dooutput) Overrides java. Doc from java. Sets the value of the A URL connection can be used for input and/or output. Set the doOutput flag to true if you intend to use the URL connection for output, false if not. The default is false. | |
| setFixedLengthStreamingMode | back to summary |
|---|---|
| public void setFixedLengthStreamingMode(int contentLength) Overrides java. Doc from java. This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is known in advance. An exception will be thrown if the application attempts to write more data than the indicated content-length, or if the application closes the OutputStream before writing the indicated amount. When output streaming is enabled, authentication and redirection cannot be handled automatically. A HttpRetryException will be thrown when reading the response if authentication or redirection are required. This exception can be queried for the details of the error. This method must be called before the URLConnection is connected. Note
| |
| setFixedLengthStreamingMode | back to summary |
|---|---|
| public void setFixedLengthStreamingMode(long contentLength) Overrides java. Doc from java. This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is known in advance. An exception will be thrown if the application attempts to write more data than the indicated content-length, or if the application closes the OutputStream before writing the indicated amount. When output streaming is enabled, authentication and redirection cannot be handled automatically. A HttpRetryException will be thrown when reading the response if authentication or redirection are required. This exception can be queried for the details of the error. This method must be called before the URLConnection is connected. The content length set by invoking this method takes precedence
over any value set by | |
| setIfModifiedSince | back to summary |
|---|---|
| public void setIfModifiedSince(long ifmodifiedsince) Overrides java. Doc from java. Sets the value of the | |
| setInstanceFollowRedirects | back to summary |
|---|---|
| public void setInstanceFollowRedirects(boolean shouldFollow) Overrides java. Doc from java. Sets whether HTTP redirects (requests with response code 3xx) should
be automatically followed by this The default value comes from followRedirects, which defaults to true. | |
| setNewClient | back to summary |
|---|---|
| protected void setNewClient(URL url) throws IOException Create a new HttpClient object, bypassing the cache of HTTP client objects/connections.
| |
| setNewClient | back to summary |
|---|---|
| protected void setNewClient(URL url, boolean useCache) throws IOException Obtain a HttpClient object. Use the cached copy if specified.
| |
| setProxiedClient | back to summary |
|---|---|
| protected void setProxiedClient(URL url, String proxyHost, int proxyPort) throws IOException Create a new HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy. This bypasses the cache of HTTP client objects/connections. | |
| setProxiedClient | back to summary |
|---|---|
| protected void setProxiedClient(URL url, String proxyHost, int proxyPort, boolean useCache) throws IOException Obtain a HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy. Use the cached copy of HTTP client objects/connections if specified. | |
| setReadTimeout | back to summary |
|---|---|
| public void setReadTimeout(int timeout) Overrides java. Doc from java. Sets the read timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when reading from Input stream when a connection is established to a resource. If the timeout expires before there is data available for read, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout. Some non-standard implementation of this method ignores the specified timeout. To see the read timeout set, please call getReadTimeout(). | |
| setRequestMethod | back to summary |
|---|---|
| public void setRequestMethod(String method) throws ProtocolException Overrides java. Doc from java. Set the method for the URL request, one of:
| |
| setRequestProperty | back to summary |
|---|---|
| public void setRequestProperty(String key, String value) Overrides java. Sets request property. If a property with the key already exists, overwrite its value with the new value.
| |
| setUseCaches | back to summary |
|---|---|
| public void setUseCaches(boolean usecaches) Overrides java. Doc from java. Sets the value of the
Some protocols do caching of documents. Occasionally, it is important
to be able to "tunnel through" and ignore the caches (e.g., the
"reload" button in a browser). If the UseCaches flag on a connection
is true, the connection is allowed to use whatever caches it can.
If false, caches are to be ignored.
The default value comes from defaultUseCaches, which defaults to
true. A default value can also be set per-protocol using
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a | |
| usingProxy | back to summary |
|---|---|
| public boolean usingProxy() Implements abstract java. Doc from java. Indicates if the connection is going through a proxy.
This method returns | |