Package htsjdk.tribble.util
Class HTTPHelper
java.lang.Object
htsjdk.tribble.util.HTTPHelper
- All Implemented Interfaces:
URLHelper
Simple implementation of URLHelper based on the JDK URL and HttpURLConnection classes. This
version optionally takes a proxy, but does not support authentication.
-
Constructor Summary
Constructors -
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.static void
-
Constructor Details
-
HTTPHelper
-
-
Method Details
-
setProxy
-
getUrl
-
getContentLength
- Specified by:
getContentLength
in interfaceURLHelper
- Returns:
- content length of the resource, or -1 if not available
- Throws:
IOException
-
openInputStream
Description copied from interface:URLHelper
Open an InputStream to stream the contents of the resource- Specified by:
openInputStream
in interfaceURLHelper
- Returns:
- Throws:
IOException
-
openInputStreamForRange
Open an InputStream to stream a slice (range) of the resource. The host server must support range byte requests and return a 206 response code (partial response). If it does not an IOException will be thrown. Its the client's responsibility to close the stream.- Specified by:
openInputStreamForRange
in interfaceURLHelper
- Parameters:
start
- start of range in bytesend
- end of range ni bytes- Returns:
- Throws:
IOException
-
exists
- Specified by:
exists
in interfaceURLHelper
- Throws:
IOException
-