Package it.unimi.dsi.law.warc.util
Class MetadataHttpResponse
java.lang.Object
it.unimi.dsi.law.warc.util.AbstractHttpResponse
it.unimi.dsi.law.warc.util.MetadataHttpResponse
- All Implemented Interfaces:
HttpResponse,Response
- Direct Known Subclasses:
MutableHttpResponse,WarcHttpResponse
public abstract class MetadataHttpResponse extends AbstractHttpResponse
An abstract extention of
AbstractHttpResponse which additionally provides support
for getting and setting metadata (i.e., uri(), statusLine(), status() and headers()).-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetadataHttpResponse.HeaderMapA special map used for headers: keys are case-insensitive, and multiple puts are converted into comma-separated values. -
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>headerMapThe header map.protected org.apache.http.StatusLinestatusLineThe status line of this response.protected URIuriThe URI that is currently contained in this response.Fields 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 MetadataHttpResponse() -
Method Summary
Modifier and Type Method Description Map<String,String>headers()Returns the headers of this response.voidheaders(Object2ObjectMap<String,String> headerMap)Sets the headers.intstatus()Returns the response status.org.apache.http.StatusLinestatusLine()Returns the response status line.voidstatusLine(org.apache.http.StatusLine statusLine)Sets the status lineURIuri()Returns the URI associated with this response.voiduri(URI url)Sets the url.Methods inherited from class it.unimi.dsi.law.warc.util.AbstractHttpResponse
toWarcRecordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.unimi.dsi.law.warc.util.HttpResponse
contentAsStreamMethods inherited from interface it.unimi.dsi.law.warc.util.Response
fromWarcRecord
-
Field Details
-
uri
The URI that is currently contained in this response. -
statusLine
protected org.apache.http.StatusLine statusLineThe status line of this response. -
headerMap
The header map.
-
-
Constructor Details
-
MetadataHttpResponse
public MetadataHttpResponse()
-
-
Method Details
-
uri
Description copied from interface:ResponseReturns the URI associated with this response.- Returns:
- the URI associated with this response.
-
status
public int status()Description copied from interface:HttpResponseReturns the response status.- Returns:
- the status of this response.
-
statusLine
public org.apache.http.StatusLine statusLine()Description copied from interface:HttpResponseReturns the response status line.- Returns:
- the status line of this response.
-
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.- Returns:
- the headers of this response.
-
uri
Sets the url.- Parameters:
url- the url.
-
statusLine
public void statusLine(org.apache.http.StatusLine statusLine)Sets the status line- Parameters:
statusLine- the status line.
-
headers
Sets the headers.- Parameters:
headerMap- the content (it may benull, in this case the headers will be left empty).
-