Package it.unimi.dsi.law.warc.util
Class MutableHttpResponse
java.lang.Object
it.unimi.dsi.law.warc.util.AbstractHttpResponse
it.unimi.dsi.law.warc.util.MetadataHttpResponse
it.unimi.dsi.law.warc.util.MutableHttpResponse
- All Implemented Interfaces:
HttpResponse
,Response
public class MutableHttpResponse extends MetadataHttpResponse
A mutable extension of
MetadataHttpResponse
that provides
support for setting the content stream.
Note that fromWarcRecord(WarcRecord)
is not implemented.-
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, uri
Fields inherited from class it.unimi.dsi.law.warc.util.AbstractHttpResponse
random
Fields inherited from interface it.unimi.dsi.law.warc.util.HttpResponse
DIGEST_HEADER, GUESSED_CHARSET_HEADER, HEADER_CHARSET, ISDUPLICATE_HEADER
-
Constructor Summary
Constructors Constructor Description MutableHttpResponse()
-
Method Summary
Modifier and Type Method Description MeasurableInputStream
contentAsStream()
Returns the content of this response as a stream.void
contentAsStream(MeasurableInputStream contentAsStream)
Sets the content.boolean
fromWarcRecord(WarcRecord wr)
Fills this response with the content of aWarcRecord
(optional operation).Methods inherited from class it.unimi.dsi.law.warc.util.MetadataHttpResponse
headers, headers, status, statusLine, statusLine, uri, uri
Methods inherited from class it.unimi.dsi.law.warc.util.AbstractHttpResponse
toWarcRecord
-
Constructor Details
-
MutableHttpResponse
public MutableHttpResponse()
-
-
Method Details
-
contentAsStream
Sets the content.- Parameters:
contentAsStream
- the content.
-
contentAsStream
Description copied from interface:HttpResponse
Returns the content of this response as a stream.- Returns:
- the content of this response as a stream.
- Throws:
IOException
-
fromWarcRecord
Description copied from interface:Response
Fills this response with the content of aWarcRecord
(optional operation).- Parameters:
wr
- the record.- Returns:
- true iff the
record-type
of the given record isresponse
. - Throws:
IOException
-