public class DefaultHTTPClient extends Object implements HTTPClient
InputStream on an HTTP URI. Is configured
with sane values for timeouts, default headers and so on.| Constructor and Description |
|---|
DefaultHTTPClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shuts down the connection manager.
|
static DefaultHTTPClient |
createInitializedHTTPClient()
Creates a
DefaultHTTPClient instance already initialized |
String |
getActualDocumentURI()
Returns the actual URI from which the document was fetched.
|
protected int |
getConnectionTimeout() |
long |
getContentLength() |
String |
getContentType()
The value of the Content-Type header reported by the server.
|
protected int |
getSoTimeout() |
void |
init(HTTPClientConfiguration configuration)
Initializes the HTTP client.
|
InputStream |
openInputStream(String uri)
Opens an
InputStream from a given URI. |
public static DefaultHTTPClient createInitializedHTTPClient()
DefaultHTTPClient instance already initializedpublic void init(HTTPClientConfiguration configuration)
HTTPClientinit in interface HTTPClientconfiguration - configuration for the HTTP Client.public InputStream openInputStream(String uri) throws IOException
InputStream from a given URI.
It follows redirects.openInputStream in interface HTTPClienturi - to be openedInputStreamIOExceptionpublic void close()
close in interface HTTPClientpublic long getContentLength()
getContentLength in interface HTTPClientpublic String getActualDocumentURI()
HTTPClientgetActualDocumentURI in interface HTTPClientpublic String getContentType()
HTTPClientgetContentType in interface HTTPClientprotected int getConnectionTimeout()
protected int getSoTimeout()
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.