Package htsjdk.tribble.util
Interface URLHelper
-
- All Known Implementing Classes:
FTPHelper,HTTPHelper,RemoteURLHelper
public interface URLHelperInterface defining a helper class for dealing with URL resources. The purpose of this class is to provide the flexibility to use alternative http implementations, for example Apache HTTPClient, and secondly to provide a hook for clients to inject custom headers, for example oAuth tokens, into the requests. An instance of URLHelper is created for a URL (there is a 1-1 relation between a URL and HRLHelper).- See Also:
HTTPHelper,FTPHelper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanexists()longgetContentLength()URLgetUrl()InputStreamopenInputStream()Open an InputStream to stream the contents of the resourceInputStreamopenInputStreamForRange(long start, long end)Open an InputStream to stream a slice (range) of the resource.
-
-
-
Method Detail
-
getUrl
URL getUrl()
- Returns:
- URL of the associated resource
-
getContentLength
long getContentLength() throws IOException- Returns:
- content length of the resource, or -1 if not available
- Throws:
IOException
-
openInputStream
InputStream openInputStream() throws IOException
Open an InputStream to stream the contents of the resource- Returns:
- Throws:
IOException
-
openInputStreamForRange
InputStream openInputStreamForRange(long start, long end) throws IOException
Open an InputStream to stream a slice (range) of the resource. May throw an OperationUnsupportedException- Parameters:
start-end-- Returns:
- Throws:
IOException
-
exists
boolean exists() throws IOException- Throws:
IOException
-
-