Package sun.net.www.protocol.https
Class AbstractDelegateHttpsURLConnection
- java.lang.Object
-
- java.net.URLConnection
-
- java.net.HttpURLConnection
-
- sun.net.www.protocol.http.HttpURLConnection
-
- sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection
-
- Direct Known Subclasses:
DelegateHttpsURLConnection
public abstract class AbstractDelegateHttpsURLConnection extends HttpURLConnection
HTTPS URL connection support. We need this delegate because HttpsURLConnection is a subclass of java.net.HttpURLConnection. We will avoid copying over the code from sun.net.www.protocol.http.HttpURLConnection by having this class
-
-
Field Summary
-
Fields inherited from class sun.net.www.protocol.http.HttpURLConnection
handler, http, ps, userAgent
-
Fields inherited from class java.net.HttpURLConnection
chunkLength, fixedContentLength, fixedContentLengthLong, 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_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION, instanceFollowRedirects, method, responseCode, responseMessage
-
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, url, useCaches
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDelegateHttpsURLConnection(URL url, Handler handler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconnect()Implements the HTTP protocol handler's "connect" method, establishing an SSL connection to the server as necessary.protected HttpClientgetNewHttpClient(URL url, int connectTimeout)protected abstract SSLSocketFactorygetSSLSocketFactory()booleanisConnected()Used by subclass to access "connected" variable.voidsetConnected(boolean conn)Used by subclass to access "connected" variable.voidsetNewClient(URL url)Create a new HttpClient object, bypassing the cache of HTTP client objects/connections.-
Methods inherited from class sun.net.www.protocol.http.HttpURLConnection
addRequestProperty, disconnect, getConnectTimeout, getErrorStream, getHeaderField, getHeaderField, getHeaderFieldKey, getHeaderFields, getInputStream, getOutputStream, getReadTimeout, getRequestProperties, getRequestProperty, openConnectionCheckRedirects, plainConnect, setAuthenticationProperty, setConnectTimeout, setReadTimeout, setRequestProperty, streaming, usingProxy
-
Methods inherited from class java.net.HttpURLConnection
getFollowRedirects, getInstanceFollowRedirects, getPermission, getRequestMethod, getResponseCode, getResponseMessage, setChunkedStreamingMode, setFixedLengthStreamingMode, setFixedLengthStreamingMode, setFollowRedirects, setInstanceFollowRedirects, setRequestMethod
-
Methods inherited from class java.net.URLConnection
getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDefaultAllowUserInteraction, getDefaultUseCaches, getDoInput, getDoOutput, getHeaderFieldInt, getHeaderFieldLong, getURL, getUseCaches, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultUseCaches, setDoInput, setDoOutput, setUseCaches, toString
-
-
-
-
Constructor Detail
-
AbstractDelegateHttpsURLConnection
protected AbstractDelegateHttpsURLConnection(URL url, Handler handler) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getSSLSocketFactory
protected abstract SSLSocketFactory getSSLSocketFactory()
-
setNewClient
public void setNewClient(URL url) throws IOException
Create a new HttpClient object, bypassing the cache of HTTP client objects/connections. Note: this method is changed from protected to public because the com.sun.ssl.internal.www.protocol.https handler reuses this class for its actual implemantation- Overrides:
setNewClientin classHttpURLConnection- Parameters:
url- the URL being accessed- Throws:
IOException
-
isConnected
public boolean isConnected()
Used by subclass to access "connected" variable.
-
setConnected
public void setConnected(boolean conn)
Used by subclass to access "connected" variable.
-
connect
public void connect() throws IOExceptionImplements the HTTP protocol handler's "connect" method, establishing an SSL connection to the server as necessary.- Overrides:
connectin classHttpURLConnection- Throws:
IOException- if an I/O error occurs while opening the connection.- See Also:
URLConnection.connected,URLConnection.getConnectTimeout(),URLConnection.setConnectTimeout(int)
-
getNewHttpClient
protected HttpClient getNewHttpClient(URL url, int connectTimeout) throws IOException
- Overrides:
getNewHttpClientin classHttpURLConnection- Throws:
IOException
-
-