Package htsjdk.tribble.util
Class HTTPHelper
- java.lang.Object
-
- htsjdk.tribble.util.HTTPHelper
-
-
Constructor Summary
Constructors Constructor Description HTTPHelper(URL url)
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.static voidsetProxy(Proxy p)
-
-
-
Constructor Detail
-
HTTPHelper
public HTTPHelper(URL url)
-
-
Method Detail
-
setProxy
public static void setProxy(Proxy p)
-
getUrl
public URL getUrl()
-
getContentLength
public long getContentLength() throws IOException- Specified by:
getContentLengthin interfaceURLHelper- Returns:
- content length of the resource, or -1 if not available
- Throws:
IOException
-
openInputStream
public InputStream openInputStream() throws IOException
Description copied from interface:URLHelperOpen an InputStream to stream the contents of the resource- Specified by:
openInputStreamin interfaceURLHelper- Returns:
- Throws:
IOException
-
openInputStreamForRange
public InputStream openInputStreamForRange(long start, long end) throws IOException
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:
openInputStreamForRangein interfaceURLHelper- Parameters:
start- start of range in bytesend- end of range ni bytes- Returns:
- Throws:
IOException
-
exists
public boolean exists() throws IOException- Specified by:
existsin interfaceURLHelper- Throws:
IOException
-
-