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)
HTTPClient
init
in interface HTTPClient
configuration
- configuration for the HTTP Client.public InputStream openInputStream(String uri) throws IOException
InputStream
from a given URI.
It follows redirects.openInputStream
in interface HTTPClient
uri
- to be openedInputStream
IOException
public void close()
close
in interface HTTPClient
public long getContentLength()
getContentLength
in interface HTTPClient
public String getActualDocumentURI()
HTTPClient
getActualDocumentURI
in interface HTTPClient
public String getContentType()
HTTPClient
getContentType
in interface HTTPClient
protected int getConnectionTimeout()
protected int getSoTimeout()
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.