public class HttpClient extends NetworkClient
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
host |
protected int |
port |
boolean |
reuse |
static java.lang.String |
SOCKET_CONNECT_ACTION |
static java.lang.String |
SOCKET_RESOLVE_ACTION |
protected java.net.URL |
url
Url being fetched.
|
connectTimeout, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT, defaultConnectTimeout, defaultSoTimeout, encoding, readTimeout, serverInput, serverOutput, serverSocket| Modifier | Constructor and Description |
|---|---|
protected |
HttpClient() |
protected |
HttpClient(java.net.URL url,
int to) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
available() |
static void |
checkConnect(java.lang.SecurityManager sm,
java.lang.String host,
int port) |
void |
closeIdleConnection() |
void |
closeServer()
Close an open connection to the server.
|
void |
finished() |
protected int |
getDefaultPort()
return default port number (subclasses may override)
|
java.io.InputStream |
getInputStream() |
java.io.OutputStream |
getOutputStream() |
java.lang.String |
getURLFile() |
static HttpClient |
New(java.net.URL url) |
static HttpClient |
New(java.net.URL url,
int to,
HttpURLConnection httpuc) |
protected void |
openServer() |
void |
openServer(java.lang.String server,
int port)
Open a connection to the server.
|
boolean |
parseHTTP(sun.net.www.MessageHeader responses,
HttpURLConnection httpuc)
Parse the first line of the HTTP request.
|
static void |
resetProperties()
Deprecated.
-- system properties are no longer cached.
|
void |
setDoNotRetry(boolean value) |
void |
setIgnoreContinue(boolean value) |
static java.lang.String[] |
splitWhitespace(java.lang.String str)
String.split("\\s+") <=> split()
|
java.lang.String |
toString() |
void |
writeRequests(sun.net.www.MessageHeader head)
Deprecated.
|
void |
writeRequests(sun.net.www.MessageHeader head,
PosterOutputStream pos) |
void |
writeRequests(sun.net.www.MessageHeader head,
PosterOutputStream pos,
boolean streaming) |
createSocket, doConnect, getConnectTimeout, getReadTimeout, serverIsOpen, setConnectTimeout, setReadTimeoutprotected java.lang.String host
protected int port
protected java.net.URL url
public boolean reuse
public static final java.lang.String SOCKET_RESOLVE_ACTION
public static final java.lang.String SOCKET_CONNECT_ACTION
protected HttpClient()
protected HttpClient(java.net.URL url,
int to)
throws java.io.IOException
java.io.IOExceptionprotected int getDefaultPort()
@Deprecated public static void resetProperties()
public static HttpClient New(java.net.URL url) throws java.io.IOException
java.io.IOExceptionpublic static HttpClient New(java.net.URL url, int to, HttpURLConnection httpuc) throws java.io.IOException
java.io.IOExceptionpublic void finished()
protected boolean available()
public void closeIdleConnection()
public void openServer(java.lang.String server,
int port)
throws java.io.IOException
NetworkClientopenServer in class NetworkClientjava.io.IOExceptionprotected void openServer()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getURLFile()
throws java.io.IOException
java.io.IOException@Deprecated public void writeRequests(sun.net.www.MessageHeader head)
public void writeRequests(sun.net.www.MessageHeader head,
PosterOutputStream pos)
throws java.io.IOException
java.io.IOExceptionpublic void writeRequests(sun.net.www.MessageHeader head,
PosterOutputStream pos,
boolean streaming)
throws java.io.IOException
java.io.IOExceptionpublic boolean parseHTTP(sun.net.www.MessageHeader responses,
HttpURLConnection httpuc)
throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String[] splitWhitespace(java.lang.String str)
public void setDoNotRetry(boolean value)
public void setIgnoreContinue(boolean value)
public void closeServer()
NetworkClientcloseServer in class NetworkClientpublic static void checkConnect(java.lang.SecurityManager sm,
java.lang.String host,
int port)