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:
  - `HTTPHelper`
  - `FTPHelper`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`exists()`
`long`
`getContentLength()`
`URL`
`getUrl()`
`InputStream`
`openInputStream()`
Open an InputStream to stream the contents of the resource
`InputStream`
`openInputStreamForRange(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

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`