Package it.unimi.dsi.law.warc.util
Class WarcHttpResponse
java.lang.Object
it.unimi.dsi.law.warc.util.AbstractHttpResponse
it.unimi.dsi.law.warc.util.MetadataHttpResponse
it.unimi.dsi.law.warc.util.WarcHttpResponse
- All Implemented Interfaces:
DigestBasedDuplicateDetection,HttpResponse,Response
public class WarcHttpResponse extends MetadataHttpResponse implements DigestBasedDuplicateDetection
An
AbstractHttpResponse implementation that reads the response
content from a WARC record (via the fromWarcRecord(WarcRecord) method.-
Nested Class Summary
Nested classes/interfaces inherited from class it.unimi.dsi.law.warc.util.MetadataHttpResponse
MetadataHttpResponse.HeaderMap -
Field Summary
Fields inherited from class it.unimi.dsi.law.warc.util.MetadataHttpResponse
headerMap, statusLine, uriFields inherited from class it.unimi.dsi.law.warc.util.AbstractHttpResponse
randomFields inherited from interface it.unimi.dsi.law.warc.util.HttpResponse
DIGEST_HEADER, GUESSED_CHARSET_HEADER, HEADER_CHARSET, ISDUPLICATE_HEADER -
Constructor Summary
Constructors Constructor Description WarcHttpResponse() -
Method Summary
Modifier and Type Method Description MeasurableInputStreamcontentAsStream()Returns the content of this response as a stream.byte[]digest()Returns the content digest.booleanfromWarcRecord(WarcRecord wr)Fills this response with the content of aWarcRecord(optional operation).Map<String,String>headers()Returns the headers of this response.booleanisDuplicate()Returns the duplicate status of this response.Methods inherited from class it.unimi.dsi.law.warc.util.MetadataHttpResponse
headers, status, statusLine, statusLine, uri, uriMethods inherited from class it.unimi.dsi.law.warc.util.AbstractHttpResponse
toWarcRecord
-
Constructor Details
-
WarcHttpResponse
public WarcHttpResponse()
-
-
Method Details
-
headers
Description copied from interface:HttpResponseReturns the headers of this response.Warning: as of LAW 3.0, and contrarily to previous behaviour, the map is case-sensitive. Use the predefined names in
HttpHeadersorHttpHeadersto avoid typing and casing mistakes.- Specified by:
headersin interfaceHttpResponse- Overrides:
headersin classMetadataHttpResponse- Returns:
- the headers of this response.
-
contentAsStream
Description copied from interface:HttpResponseReturns the content of this response as a stream.- Specified by:
contentAsStreamin interfaceHttpResponse- Returns:
- the content of this response as a stream.
-
fromWarcRecord
Description copied from interface:ResponseFills this response with the content of aWarcRecord(optional operation).- Specified by:
fromWarcRecordin interfaceResponse- Parameters:
wr- the record.- Returns:
- true iff the
record-typeof the given record isresponse. - Throws:
IOException
-
digest
public byte[] digest()Description copied from interface:DigestBasedDuplicateDetectionReturns the content digest.- Specified by:
digestin interfaceDigestBasedDuplicateDetection- Returns:
- the digest.
-
isDuplicate
public boolean isDuplicate()Description copied from interface:DigestBasedDuplicateDetectionReturns the duplicate status of this response.- Specified by:
isDuplicatein interfaceDigestBasedDuplicateDetection- Returns:
- whether this response is a duplicate.
-