Package htsjdk.samtools.util.htsget
Class HtsgetResponse
- java.lang.Object
-
- htsjdk.samtools.util.htsget.HtsgetResponse
-
public class HtsgetResponse extends Object
Class allowing deserialization from json htsget response, as defined in https://samtools.github.io/hts-specs/htsget.htmlThis class currently supports version 1.2.0 of the spec
An example response could be as follows { "htsget" : { "format" : "BAM", "urls" : [ { "url" : "data:application/vnd.ga4gh.bam;base64,QkFNAQ==", "class" : "header" }, { "url" : "https://htsget.blocksrv.example/sample1234/run1.bam", "headers" : { "Authorization" : "Bearer xxxx", "Range" : "bytes=65536-1003750" }, "class" : "body" } ], "md5": "abcd" } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHtsgetResponse.Block
-
Constructor Summary
Constructors Constructor Description HtsgetResponse(HtsgetFormat format, List<HtsgetResponse.Block> blocks, String md5)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<HtsgetResponse.Block>getBlocks()InputStreamgetDataStream()Lazily generates an InputStream over this response's data from the concatenation of the InputStreams from each of the response's data blocksHtsgetFormatgetFormat()StringgetMd5()static HtsgetResponseparse(String s)Parses HtsgetResponse object from json string
-
-
-
Constructor Detail
-
HtsgetResponse
public HtsgetResponse(HtsgetFormat format, List<HtsgetResponse.Block> blocks, String md5)
-
-
Method Detail
-
getFormat
public HtsgetFormat getFormat()
-
getBlocks
public List<HtsgetResponse.Block> getBlocks()
-
getMd5
public String getMd5()
-
parse
public static HtsgetResponse parse(String s)
Parses HtsgetResponse object from json string- Parameters:
s- json string- Returns:
- parsed HtsgetResponse object
-
getDataStream
public InputStream getDataStream()
Lazily generates an InputStream over this response's data from the concatenation of the InputStreams from each of the response's data blocks- Returns:
- InputStream over this response's data
-
-