Package net.sf.basedb.util.uri
Interface ConnectionManager
- All Known Subinterfaces:
ResumableConnectionManager
- All Known Implementing Classes:
HttpConnectionManager
public interface ConnectionManager
A connection manager is used to access the contents and metadata about
the resource pointed to by a given URI. Connection managers are usually
created by
ConnectionManagerFactory
objects. Implementations
doesn't have to be thread-safe since a new connection manager is created
for each use of an URI. Implementations doens't have to provide a public
no-argument constructor.
NOTE! Also consider implementing the ResumableConnectionManager
interface if the protocol supports setting a start offset for the
download.
- Since:
- 3.0
- Author:
- Nicklas
- Last modified
- $Date: 2014-06-26 08:48:25 +0200 (to, 26 jun 2014) $
-
Method Summary
Modifier and TypeMethodDescriptionGet an InputStream for reading the contents of the resource.Get metadata about the resource.getURI()
Get the URI of the resource we are interested in.
-
Method Details
-
getURI
URI getURI()Get the URI of the resource we are interested in.- Returns:
- An URI
-
getInputStream
Get an InputStream for reading the contents of the resource.- Returns:
- An InputStream object, or null if the no data is available
- Throws:
IOException
- If there is an error creating the stream
-
getMetadata
Get metadata about the resource. If no metadata can be obtained the handler should still create an empty UriMetadata object.- Returns:
- A metadata object
- Throws:
IOException
- If there is an error getting the metadata
-