|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.util.WebResponseWrapper
public class WebResponseWrapper
Provides a convenient implementation of the WebResponse
interface that can be subclassed
by developers wishing to adapt a particular WebResponse.
This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped
web connection object.
Constructor Summary | |
---|---|
WebResponseWrapper(WebResponse webResponse)
Constructs a WebResponse object wrapping provided WebResponse. |
Method Summary | |
---|---|
java.io.InputStream |
getContentAsStream()
Return the content from the server as an input stream The default behavior of this method is to return getContentAsStream() on the wrapped connection object. |
java.lang.String |
getContentAsString()
Return the content from the server as a string The default behavior of this method is to return getContentAsString() on the wrapped connection object. |
java.lang.String |
getContentCharSet()
Return the content charset value. The default behavior of this method is to return getContentCharSet() on the wrapped connection object. |
java.lang.String |
getContentType()
Return the content type returned from the server. The default behavior of this method is to return getContentType() on the wrapped connection object. |
long |
getLoadTimeInMilliSeconds()
Return the time it took to load this web response in milliseconds. The default behavior of this method is to return getLoadTimeInMilliSeconds() on the wrapped connection object. |
SubmitMethod |
getRequestMethod()
Return the method used for the request resulting into this response. The default behavior of this method is to return getRequestMethod() on the wrapped connection object. |
byte[] |
getResponseBody()
Return the response body as byte array. The default behavior of this method is to return getResponseBody() on the wrapped connection object. |
java.util.List |
getResponseHeaders()
Return the response headers as a List of NameValuePair s.
The default behavior of this method is to return getResponseHeaders() on the wrapped connection object. |
java.lang.String |
getResponseHeaderValue(java.lang.String headerName)
Return the value of the specified header from this response. The default behavior of this method is to return getResponseHeaderValue() on the wrapped connection object. |
int |
getStatusCode()
Return the status code that was returned by the server The default behavior of this method is to return getStatusCode() on the wrapped connection object. |
java.lang.String |
getStatusMessage()
Return the status message that was returned from the server The default behavior of this method is to return getStatusMessage() on the wrapped connection object. |
java.net.URL |
getUrl()
Return the URL that was used to load this page. The default behavior of this method is to return getUrl() on the wrapped connection object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebResponseWrapper(WebResponse webResponse) throws java.lang.IllegalArgumentException
webResponse
- the webResponse that does the real work
java.lang.IllegalArgumentException
- if the connection is null
Method Detail |
---|
public java.io.InputStream getContentAsStream() throws java.io.IOException
getContentAsStream
in interface WebResponse
java.io.IOException
- If an IO problem occurspublic java.lang.String getContentAsString()
getContentAsString
in interface WebResponse
public java.lang.String getContentCharSet()
getContentCharSet
in interface WebResponse
public java.lang.String getContentType()
getContentType
in interface WebResponse
public long getLoadTimeInMilliSeconds()
getLoadTimeInMilliSeconds
in interface WebResponse
public SubmitMethod getRequestMethod()
getRequestMethod
in interface WebResponse
public byte[] getResponseBody()
getResponseBody
in interface WebResponse
public java.util.List getResponseHeaders()
NameValuePair
s.
The default behavior of this method is to return getResponseHeaders() on the wrapped connection object.
getResponseHeaders
in interface WebResponse
NameValuePair
s.public java.lang.String getResponseHeaderValue(java.lang.String headerName)
getResponseHeaderValue
in interface WebResponse
headerName
- The name of the header
public int getStatusCode()
getStatusCode
in interface WebResponse
public java.lang.String getStatusMessage()
getStatusMessage
in interface WebResponse
public java.net.URL getUrl()
getUrl
in interface WebResponse
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |