Class HttpResponse
- java.lang.Object
-
- org.apache.nutch.protocol.interactiveselenium.HttpResponse
-
- All Implemented Interfaces:
HttpHeaders,Response
public class HttpResponse extends Object implements Response
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classHttpResponse.Scheme-
Nested classes/interfaces inherited from interface org.apache.nutch.net.protocols.Response
Response.TruncatedContentReason
-
-
Field Summary
-
Fields inherited from interface org.apache.nutch.metadata.HttpHeaders
CLIENT_TRANSFER_ENCODING, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_TYPE, IF_MODIFIED_SINCE, LAST_MODIFIED, LOCATION, TRANSFER_ENCODING, USER_AGENT, WRITABLE_CONTENT_TYPE
-
Fields inherited from interface org.apache.nutch.net.protocols.Response
FETCH_TIME, IP_ADDRESS, REQUEST, RESPONSE_HEADERS, TRUNCATED_CONTENT, TRUNCATED_CONTENT_REASON
-
-
Constructor Summary
Constructors Constructor Description HttpResponse(Http http, URL url, CrawlDatum datum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCode()Get the response code.byte[]getContent()Get the full content of the response.StringgetHeader(String name)Get the value of a named header.MetadatagetHeaders()Get all the headers.URLgetUrl()Get the URL used to retrieve this response.
-
-
-
Constructor Detail
-
HttpResponse
public HttpResponse(Http http, URL url, CrawlDatum datum) throws ProtocolException, IOException
- Throws:
ProtocolExceptionIOException
-
-
Method Detail
-
getUrl
public URL getUrl()
Description copied from interface:ResponseGet the URL used to retrieve this response.
-
getCode
public int getCode()
Description copied from interface:ResponseGet the response code.
-
getHeader
public String getHeader(String name)
Description copied from interface:ResponseGet the value of a named header.
-
getHeaders
public Metadata getHeaders()
Description copied from interface:ResponseGet all the headers.- Specified by:
getHeadersin interfaceResponse- Returns:
- populated headers
Metadata
-
getContent
public byte[] getContent()
Description copied from interface:ResponseGet the full content of the response.- Specified by:
getContentin interfaceResponse- Returns:
- a byte array representing the response content
-
-