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()).
  • Field Details

    • uri

      protected URI uri
      The URI that is currently contained in this response.
    • statusLine

      protected org.apache.http.StatusLine statusLine
      The status line of this response.
    • headerMap

      protected final Map<String,​String> headerMap
      The header map.
  • Constructor Details

    • MetadataHttpResponse

      public MetadataHttpResponse()
  • Method Details

    • uri

      public URI uri()
      Description copied from interface: Response
      Returns the URI associated with this response.
      Returns:
      the URI associated with this response.
    • status

      public int status()
      Description copied from interface: HttpResponse
      Returns the response status.
      Returns:
      the status of this response.
    • statusLine

      public org.apache.http.StatusLine statusLine()
      Description copied from interface: HttpResponse
      Returns the response status line.
      Returns:
      the status line of this response.
    • headers

      public Map<String,​String> headers()
      Description copied from interface: HttpResponse
      Returns 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 HttpHeaders or HttpHeaders to avoid typing and casing mistakes.

      Returns:
      the headers of this response.
    • uri

      public void uri​(URI url)
      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

      public void headers​(Object2ObjectMap<String,​String> headerMap)
      Sets the headers.
      Parameters:
      headerMap - the content (it may be null, in this case the headers will be left empty).