Package htsjdk.tribble.util
Interface URLHelper
- All Known Implementing Classes:
FTPHelper
,HTTPHelper
,RemoteURLHelper
public interface URLHelper
Interface 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:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
exists()
long
getUrl()
Open an InputStream to stream the contents of the resourceopenInputStreamForRange
(long start, long end) Open an InputStream to stream a slice (range) of the resource.
-
Method Details
-
getUrl
URL getUrl()- Returns:
- URL of the associated resource
-
getContentLength
- Returns:
- content length of the resource, or -1 if not available
- Throws:
IOException
-
openInputStream
Open an InputStream to stream the contents of the resource- Returns:
- Throws:
IOException
-
openInputStreamForRange
Open an InputStream to stream a slice (range) of the resource. May throw an OperationUnsupportedException- Parameters:
start
-end
-- Returns:
- Throws:
IOException
-
exists
- Throws:
IOException
-