public class Page extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
contentCharset
The charset of the content.
|
protected byte[] |
contentData
The content of this page in binary format.
|
protected String |
contentEncoding
The encoding of the content.
|
protected String |
contentType
The ContentType of this page.
|
protected org.apache.http.Header[] |
fetchResponseHeaders
Headers which were present in the response of the fetch request
|
protected ParseData |
parseData
The parsed data populated by parsers
|
protected boolean |
redirect
Redirection flag
|
protected String |
redirectedToUrl
The URL to which this page will be redirected to
|
protected int |
statusCode
Status of the page
|
protected boolean |
truncated
Whether the content was truncated because the received data exceeded the imposed maximum
|
protected WebURL |
url
The URL of this page.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getContentCharset() |
byte[] |
getContentData() |
String |
getContentEncoding() |
String |
getContentType() |
org.apache.http.Header[] |
getFetchResponseHeaders()
Returns headers which were present in the response of the fetch request
|
String |
getLanguage() |
ParseData |
getParseData() |
String |
getRedirectedToUrl() |
int |
getStatusCode() |
WebURL |
getWebURL() |
boolean |
isRedirect() |
boolean |
isTruncated() |
void |
load(org.apache.http.HttpEntity entity,
int maxBytes)
Loads the content of this page from a fetched HttpEntity.
|
void |
setContentCharset(String contentCharset) |
void |
setContentData(byte[] contentData) |
void |
setContentEncoding(String contentEncoding) |
void |
setContentType(String contentType) |
void |
setFetchResponseHeaders(org.apache.http.Header[] headers) |
void |
setLanguage(String language) |
void |
setParseData(ParseData parseData) |
void |
setRedirect(boolean redirect) |
void |
setRedirectedToUrl(String redirectedToUrl) |
void |
setStatusCode(int statusCode) |
void |
setWebURL(WebURL url) |
protected byte[] |
toByteArray(org.apache.http.HttpEntity entity,
int maxBytes)
Read contents from an entity, with a specified maximum.
|
protected WebURL url
protected boolean redirect
protected String redirectedToUrl
protected int statusCode
protected byte[] contentData
protected String contentType
protected String contentEncoding
protected String contentCharset
protected org.apache.http.Header[] fetchResponseHeaders
protected ParseData parseData
protected boolean truncated
public Page(WebURL url)
public void load(org.apache.http.HttpEntity entity,
int maxBytes)
throws Exception
entity - HttpEntitymaxBytes - The maximum number of bytes to readException - when load failsprotected byte[] toByteArray(org.apache.http.HttpEntity entity,
int maxBytes)
throws IOException
entity - The entity from which to readmaxBytes - The maximum number of bytes to readIOException - Thrown when reading fails for any reasonpublic WebURL getWebURL()
public void setWebURL(WebURL url)
public boolean isRedirect()
public void setRedirect(boolean redirect)
public String getRedirectedToUrl()
public void setRedirectedToUrl(String redirectedToUrl)
public int getStatusCode()
public void setStatusCode(int statusCode)
public org.apache.http.Header[] getFetchResponseHeaders()
public void setFetchResponseHeaders(org.apache.http.Header[] headers)
public ParseData getParseData()
public void setParseData(ParseData parseData)
public byte[] getContentData()
public void setContentData(byte[] contentData)
public String getContentType()
public void setContentType(String contentType)
public String getContentEncoding()
public void setContentEncoding(String contentEncoding)
public String getContentCharset()
public void setContentCharset(String contentCharset)
public String getLanguage()
public void setLanguage(String language)
public boolean isTruncated()
Copyright © 2017. All rights reserved.