public class HttpConnectionManager extends java.lang.Object implements ResumableConnectionManager
Modifier and Type | Class and Description |
---|---|
static class |
HttpConnectionManager.CloseableHttpClient
Closable implementation that closes the given HttpClient
when the close() method is called.
|
Modifier and Type | Field and Description |
---|---|
private UriMetadata |
metadata |
private ConnectionParameters |
parameters |
private java.net.URI |
uri |
Constructor and Description |
---|
HttpConnectionManager(java.net.URI uri,
ConnectionParameters parameters) |
Modifier and Type | Method and Description |
---|---|
org.apache.http.client.HttpClient |
createHttpClient(java.net.URI uri,
ConnectionParameters parameters)
Get a HttpClient object that has been configured to access the
given URI.
|
UriMetadata |
createMetadata(java.net.URI uri,
org.apache.http.HttpResponse response)
Read metadata from the given http response and put the information
in a UriMetadata object.
|
java.io.InputStream |
getInputStream()
Get an InputStream for reading the contents of the resource.
|
java.io.InputStream |
getInputStream(long offset)
Get an InputStream for reading the contents of the resource.
|
UriMetadata |
getMetadata()
Get metadata about the resource.
|
java.net.URI |
getURI()
Get the URI of the resource we are interested in.
|
private final java.net.URI uri
private final ConnectionParameters parameters
private UriMetadata metadata
public HttpConnectionManager(java.net.URI uri, ConnectionParameters parameters)
public java.net.URI getURI()
ConnectionManager
getURI
in interface ConnectionManager
public java.io.InputStream getInputStream() throws java.io.IOException
ConnectionManager
getInputStream
in interface ConnectionManager
java.io.IOException
- If there is an error creating the streampublic java.io.InputStream getInputStream(long offset) throws java.io.IOException
ResumableConnectionManager
getInputStream
in interface ResumableConnectionManager
offset
- The offset to start reading fromjava.io.IOException
- If there is an error creating the streampublic UriMetadata getMetadata() throws java.io.IOException
ConnectionManager
getMetadata
in interface ConnectionManager
java.io.IOException
- If there is an error getting the metadatapublic org.apache.http.client.HttpClient createHttpClient(java.net.URI uri, ConnectionParameters parameters) throws java.io.IOException
java.io.IOException
public UriMetadata createMetadata(java.net.URI uri, org.apache.http.HttpResponse response)