|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.util.WebConnectionWrapper
com.gargoylesoftware.htmlunit.util.FalsifyingWebConnection
public abstract class FalsifyingWebConnection
Extension of WebConnectionWrapper
providing facility methods to deliver something other than
what the wrapped connection would deliver.
Constructor Summary | |
---|---|
FalsifyingWebConnection(WebClient webClient)
Constructs an instance and places itself as connection of the WebClient. |
|
FalsifyingWebConnection(WebConnection webConnection)
Constructs a WebConnection object wrapping provided WebConnection. |
Method Summary | |
---|---|
protected WebResponse |
createWebResponse(WebRequestSettings wr,
java.lang.String content,
java.lang.String contentType)
Creates a faked WebResponse for the request with the provided content. |
protected WebResponse |
createWebResponse(WebRequestSettings wr,
java.lang.String content,
java.lang.String contentType,
int responseCode,
java.lang.String responseMessage)
Creates a faked WebResponse for the request with the provided content. |
protected WebResponse |
deliverFromAlternateUrl(WebRequestSettings webRequestSettings,
java.net.URL url)
Delivers the content for an alternate URL as if it comes from the requested URL. |
protected WebResponse |
replaceContent(WebResponse wr,
java.lang.String newContent)
Builds a WebResponse with new content, preserving all other information. |
Methods inherited from class com.gargoylesoftware.htmlunit.util.WebConnectionWrapper |
---|
getResponse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FalsifyingWebConnection(WebConnection webConnection) throws java.lang.IllegalArgumentException
webConnection
- the webConnection that does the real work
java.lang.IllegalArgumentException
- if the connection is null
public FalsifyingWebConnection(WebClient webClient) throws java.lang.IllegalArgumentException
webClient
- the WebClient which WebConnection should be wrapped
java.lang.IllegalArgumentException
- if the WebClient is null
Method Detail |
---|
protected WebResponse deliverFromAlternateUrl(WebRequestSettings webRequestSettings, java.net.URL url) throws java.io.IOException
webRequestSettings
- the original web request settingsurl
- the URL from which the content should be retrieved
java.io.IOException
- if a problem occurredprotected WebResponse replaceContent(WebResponse wr, java.lang.String newContent) throws java.io.IOException
wr
- the web response to adaptnewContent
- the new content to place in the response
java.io.IOException
- if an encoding problem occurredprotected WebResponse createWebResponse(WebRequestSettings wr, java.lang.String content, java.lang.String contentType) throws java.io.IOException
wr
- the web request for which a response should be createdcontent
- the content to place in the responsecontentType
- the content type of the response
java.io.IOException
- if an encoding problem occurredprotected WebResponse createWebResponse(WebRequestSettings wr, java.lang.String content, java.lang.String contentType, int responseCode, java.lang.String responseMessage) throws java.io.IOException
wr
- the web request for which a response should be createdcontent
- the content to place in the responsecontentType
- the content type of the responseresponseCode
- the HTTP code for the responseresponseMessage
- the HTTP message for the response
java.io.IOException
- if an encoding problem occurred
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |