Package org.htmlunit
Class WebResponseFromCache
java.lang.Object
org.htmlunit.WebResponse
org.htmlunit.util.WebResponseWrapper
org.htmlunit.WebResponseFromCache
- All Implemented Interfaces:
Serializable
A
WebResponse
implementation to deliver with content from cache. The response
is the same but the request may have some variation like an anchor.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebResponseFromCache
(WebResponse cachedResponse, List<NameValuePair> overwriteHeaders, WebRequest currentRequest) Wraps the provided cached response for a new request.WebResponseFromCache
(WebResponse cachedResponse, WebRequest currentRequest) Wraps the provided response for the given request -
Method Summary
Modifier and TypeMethodDescriptionReturns the response headers as a list ofNameValuePair
s.getResponseHeaderValue
(String headerName) Returns the value of the specified response header.Returns the request used to load this response.Methods inherited from class org.htmlunit.util.WebResponseWrapper
cleanUp, defaultCharsetUtf8, getContentAsStream, getContentAsStreamWithBomIfApplicable, getContentAsString, getContentAsString, getContentCharset, getContentCharsetOrNull, getContentLength, getContentType, getHeaderContentCharset, getLoadTime, getStatusCode, getStatusMessage, isSuccess, isSuccessOrUseProxy, isSuccessOrUseProxyOrNotModified, wasContentCharsetTentative
Methods inherited from class org.htmlunit.WebResponse
getBlockReason, markAsBlocked, wasBlocked
-
Field Details
-
request_
-
responseHeaders_
-
-
Constructor Details
-
WebResponseFromCache
WebResponseFromCache(WebResponse cachedResponse, List<NameValuePair> overwriteHeaders, WebRequest currentRequest) Wraps the provided cached response for a new request.- Parameters:
cachedResponse
- the response from cacheoverwriteHeaders
- list of headers to overwrite cachedResponse headerscurrentRequest
- the new request
-
WebResponseFromCache
WebResponseFromCache(WebResponse cachedResponse, WebRequest currentRequest) Wraps the provided response for the given request- Parameters:
cachedResponse
- the response from cachecurrentRequest
- the new request
-
-
Method Details
-
getWebRequest
Returns the request used to load this response. The default behavior of this method is to return getWebRequest() on the wrapped webResponse object.- Overrides:
getWebRequest
in classWebResponseWrapper
- Returns:
- the request used to load this response
-
getResponseHeaders
Returns the response headers as a list ofNameValuePair
s. The default behavior of this method is to return getResponseHeaders() on the wrapped webResponse object.- Overrides:
getResponseHeaders
in classWebResponseWrapper
- Returns:
- the response headers as a list of
NameValuePair
s
-
getResponseHeaderValue
Returns the value of the specified response header. The default behavior of this method is to return getResponseHeaderValue() on the wrapped webResponse object.- Overrides:
getResponseHeaderValue
in classWebResponseWrapper
- Parameters:
headerName
- the name of the header whose value is to be returned- Returns:
- the header value,
null
if no response header exists with this name
-