public class HttpURLConnection
extends sun.net.www.protocol.http.HttpURLConnection
cachedResponse, handler, http, instProxy, pi, ps, userAgent
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_SERVER_ERROR, HTTP_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION, instanceFollowRedirects, method, responseCode, responseMessage
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
Modifier | Constructor and Description |
---|---|
protected |
HttpURLConnection(URL url,
Proxy proxy,
Handler handler)
Creates a connection.
|
Modifier and Type | Method and Description |
---|---|
static SocketFactory |
getDefaultSocketFactory()
Gets the default static
SocketFactory that is
inherited by new instances of this class. |
protected HttpClient |
getNewHttpClient(URL url,
Proxy p,
int connectTimeout) |
SocketFactory |
getSocketFactory()
Gets the socket factory to be used when creating sockets
for secure https URL connections.
|
protected void |
proxiedConnect(URL url,
String proxyHost,
int proxyPort,
boolean useCache)
Connects via proxy.
|
static void |
setDefaultSocketFactory(SocketFactory sf)
Sets the default
SocketFactory inherited by new
instances of this class. |
protected void |
setNewClient(URL url,
boolean useCache)
Obtain a HttpClient object.
|
void |
setSocketFactory(SocketFactory sf)
Sets the
SocketFactory to be used when this instance
creates sockets for secure https URL connections. |
addRequestProperty, authObj, authObj, connect, disconnect, doTunneling, getConnectTimeout, getCookieHandler, getErrorStream, getHeaderField, getHeaderField, getHeaderFieldKey, getHeaderFields, getHttpLogger, getInputStream, getNewHttpClient, getOutputStream, getReadTimeout, getRequestProperties, getRequestProperty, openConnectionCheckRedirects, plainConnect, plainConnect0, setAuthenticationProperty, setConnectTimeout, setDefaultAuthenticator, setNewClient, setProxiedClient, setProxiedClient, setReadTimeout, setRequestMethod, setRequestProperty, setTunnelState, streaming, usingProxy
getFollowRedirects, getHeaderFieldDate, getInstanceFollowRedirects, getPermission, getRequestMethod, getResponseCode, getResponseMessage, setChunkedStreamingMode, setFixedLengthStreamingMode, setFixedLengthStreamingMode, setFollowRedirects, setInstanceFollowRedirects
getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldInt, getHeaderFieldLong, getIfModifiedSince, getLastModified, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setUseCaches, toString
protected HttpURLConnection(URL url, Proxy proxy, Handler handler) throws IOException
url
- The target URLproxy
- Proxy, if anyhandler
- The protocol handlerIOException
protected void setNewClient(URL url, boolean useCache) throws IOException
setNewClient
in class sun.net.www.protocol.http.HttpURLConnection
url
- the URL being accesseduseCache
- whether the cached connection should be used
if presentIOException
- Communication errorprotected void proxiedConnect(URL url, String proxyHost, int proxyPort, boolean useCache) throws IOException
proxiedConnect
in class sun.net.www.protocol.http.HttpURLConnection
url
- The URL to connectproxyHost
- The proxy hostproxyPort
- The proxy portuseCache
- Whether to use cached connectionsIOException
- Communication errorprotected HttpClient getNewHttpClient(URL url, Proxy p, int connectTimeout) throws IOException
getNewHttpClient
in class sun.net.www.protocol.http.HttpURLConnection
IOException
public static void setDefaultSocketFactory(SocketFactory sf)
SocketFactory
inherited by new
instances of this class.
The socket factories are used when creating sockets for secure https URL connections.
sf
- the default socket factoryIllegalArgumentException
- if the SocketFactory
parameter is null.getDefaultSocketFactory()
public static SocketFactory getDefaultSocketFactory()
SocketFactory
that is
inherited by new instances of this class.
The socket factories are used when creating sockets for secure https URL connections.
SocketFactory
setDefaultSocketFactory(SocketFactory)
public void setSocketFactory(SocketFactory sf)
SocketFactory
to be used when this instance
creates sockets for secure https URL connections.
New instances of this class inherit the default static
SocketFactory
set by
setDefaultSocketFactory
. Calls to this method replace
this object's SocketFactory
.
sf
- the socket factoryIllegalArgumentException
- if the SocketFactory
parameter is null.getSocketFactory()
public SocketFactory getSocketFactory()
SocketFactory
setSocketFactory(SocketFactory)