public class HttpClient
extends sun.net.www.http.HttpClient
Modifier and Type | Field and Description |
---|---|
protected boolean |
inCache
Superclass' inCache is private.
|
Modifier | Constructor and Description |
---|---|
protected |
HttpClient(URL url,
Proxy proxy,
int to)
Subclass constructor for the client.
|
Modifier and Type | Method and Description |
---|---|
protected Socket |
doConnect(String server,
int port)
Return a socket connected to the server, with any
appropriate options pre-established.
|
static HttpClient |
New(URL url,
Proxy p,
int to,
boolean useCache)
Instantiates a HttpClient.
|
static HttpClient |
New(URL url,
String proxyHost,
int proxyPort,
boolean useCache,
int timeout)
Instantiates a HttpClient.
|
protected void |
putInKeepAliveCache() |
protected static void |
setSocketFactory(SocketFactory sf)
Sets the socket factory for creating sockets used by this client.
|
afterConnect, available, closeIdleConnection, closeServer, finalize, finished, getDefaultPort, getHttpKeepAliveSet, getInputStream, getOutputStream, getProxyHostUsed, getProxyPortUsed, getURLFile, isCachedConnection, isInKeepAliveCache, isKeepingAlive, needsTunneling, New, New, New, New, New, New, newHttpProxy, openServer, openServer, parseHTTP, resetProperties, setCacheRequest, setDoNotRetry, setIgnoreContinue, toString, writeRequests, writeRequests, writeRequests
protected boolean inCache
protected HttpClient(URL url, Proxy proxy, int to) throws IOException
url
- The URLproxy
- Proxies, if anyto
- The connect timeoutIOException
- If an error occurspublic static HttpClient New(URL url, String proxyHost, int proxyPort, boolean useCache, int timeout) throws IOException
url
- The URL to connectproxyHost
- The proxy server, null if no proxyproxyPort
- The proxy server portuseCache
- Whether to use a client from cache or nottimeout
- The connect timeout, -1 if no timeoutIOException
- An I/O error occurredpublic static HttpClient New(URL url, Proxy p, int to, boolean useCache) throws IOException
url
- The URL to connectp
- The proxy server, null if no proxyto
- The connect timeout, -1 if no timeoutuseCache
- Whether to use a client from cache or notIOException
- An I/O error occurredprotected void putInKeepAliveCache()
putInKeepAliveCache
in class sun.net.www.http.HttpClient
protected Socket doConnect(String server, int port) throws IOException, UnknownHostException
doConnect
in class sun.net.NetworkClient
server
- The server to connect toport
- The port to connect toIOException
- Communication errorUnknownHostException
- The host cannot be foundprotected static void setSocketFactory(SocketFactory sf)
sf
- The socket factory