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