public class WebResponseImpl extends Object implements WebResponse, Serializable
WebResponse.| Constructor and Description |
|---|
WebResponseImpl(WebResponseData responseData,
String charset,
URL url,
SubmitMethod requestMethod,
long loadTime)
Construct with all data
|
WebResponseImpl(WebResponseData responseData,
URL url,
SubmitMethod requestMethod,
long loadTime)
Construct with all data
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getContentAsStream()
Return the content from the server as an input stream
|
String |
getContentAsString()
Return the content from the server as a string
|
String |
getContentCharSet()
Return the content charset value.
|
String |
getContentType()
Return the content type returned from the server.
|
long |
getLoadTimeInMilliSeconds()
Return the time it took to load this web response in milliseconds.
|
SubmitMethod |
getRequestMethod()
Return the method used for the request resulting into this response.
|
byte[] |
getResponseBody()
Return the response body as byte array.
|
List |
getResponseHeaders()
Return the response headers as a List of
NameValuePairs. |
String |
getResponseHeaderValue(String headerName)
Return the value of the specified header from this response.
|
int |
getStatusCode()
Return the status code that was returned by the server
|
String |
getStatusMessage()
Return the status message that was returned from the server
|
URL |
getUrl()
Return the URL that was used to load this page.
|
public WebResponseImpl(WebResponseData responseData, URL url, SubmitMethod requestMethod, long loadTime)
responseData - Data that was send backurl - Where this response came fromrequestMethod - The method used to get this responseloadTime - How long the response took to be sentpublic WebResponseImpl(WebResponseData responseData, String charset, URL url, SubmitMethod requestMethod, long loadTime)
responseData - Data that was send backcharset - Charset used if not returned in the response.url - Where this response came fromrequestMethod - The method used to get this responseloadTime - How long the response took to be sentpublic int getStatusCode()
getStatusCode in interface WebResponsepublic String getStatusMessage()
getStatusMessage in interface WebResponsepublic String getContentType()
getContentType in interface WebResponsepublic String getContentAsString()
getContentAsString in interface WebResponsepublic InputStream getContentAsStream() throws IOException
getContentAsStream in interface WebResponseIOException - If an IO problem occurspublic URL getUrl()
getUrl in interface WebResponsepublic SubmitMethod getRequestMethod()
getRequestMethod in interface WebResponsepublic List getResponseHeaders()
NameValuePairs.getResponseHeaders in interface WebResponseNameValuePairs.public String getResponseHeaderValue(String headerName)
getResponseHeaderValue in interface WebResponseheaderName - The name of the headerpublic long getLoadTimeInMilliSeconds()
getLoadTimeInMilliSeconds in interface WebResponsepublic String getContentCharSet()
getContentCharSet in interface WebResponseTextUtil.DEFAULT_CHARSET if it can't be determinedpublic byte[] getResponseBody()
getResponseBody in interface WebResponseCopyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.