Method Summary |
|
public void | addClientListener(WebClientListener listener) Adds a listener to watch for requests and responses. |
public void | addCookie(String name, String value) Defines a cookie to be sent to the server on every request. |
public void | addWindowListener(WebWindowListener listener) Adds a listener to watch for window openings and closings. |
public void | clearContents() Resets the state of this client, removing all cookies, frames, and per-client headers. |
public void | clearProxyServer() Clears the proxy server settings. |
void | close(WebWindow window) |
FrameSelector | findFrame(String target) |
public ClientProperties | getClientProperties() Returns the properties associated with this client. |
boolean | getConfirmationResponse(String message) |
CookieJar | getCookieJar() |
public String[] | getCookieNames() Returns the name of all the active cookies which will be sent to the server. |
public String | getCookieValue(String name) Returns the value of the specified cookie. |
public WebResponse | getCurrentPage() Returns the response representing the current top page in the main window. |
public boolean | getExceptionsThrownOnErrorStatus() Returns true if an exception will be thrown when an error status (4xx or 5xx) is detected on a response. |
public WebResponse | getFrameContents(String frameName) Returns the response associated with the specified frame name in the main window. |
public WebResponse | getFrameContents(FrameSelector targetFrame) Returns the response associated with the specified frame name in the main window. |
public String[] | getFrameNames() Returns the name of the currently active frames in the main window. |
public String | getHeaderField(String fieldName) Returns the value for the header field with the specified name. |
protected Dictionary | getHeaderFields(URL targetURL) Returns the value of all current header fields. |
public WebWindow | getMainWindow() |
public String | getNextAlert() Returns the next javascript alert without removing it from the queue. |
public WebWindow | getOpenWindow(String name) |
public WebWindow[] | getOpenWindows() |
public String | getProxyHost() Returns the name of the active proxy server. |
public int | getProxyPort() Returns the number of the active proxy port, or 0 is none is specified. |
public WebResponse | getResource(WebRequest request) Returns the resource specified by the request. |
public WebResponse | getResponse(String urlString) Submits a GET method request and returns a response. |
public WebResponse | getResponse(WebRequest request) Submits a web request and returns a response, using all state developed so far as stored in
cookies as requested by the server. |
public String | getUserAgent() Returns the current user agent setting. |
String | getUserResponse(String message, String defaultResponse) |
abstract protected WebResponse | newResponse(WebRequest request, FrameSelector targetFrame) Creates a web response object which represents the response to the specified web request. |
public String | popNextAlert() Returns the next javascript alert and removes it from the queue. |
void | postAlert(String message) |
public void | putCookie(String name, String value) Defines a cookie to be sent to the server on every request. |
public void | removeClientListener(WebClientListener listener) Removes a listener to watch for requests and responses. |
public void | removeWindowListener(WebWindowListener listener) Removes a listener to watch for window openings and closings. |
public WebResponse | sendRequest(WebRequest request) Submits a web request and returns a response. |
public void | setAuthorization(String userName, String password) Sets a username and password for a basic authentication scheme. |
public void | setDialogResponder(DialogResponder responder) Specifies the object which will respond to all dialogs. |
public void | setExceptionsThrownOnErrorStatus(boolean throwExceptions) Specifies whether an exception will be thrown when an error status (4xx or 5xx) is detected on a response. |
public void | setHeaderField(String fieldName, String fieldValue) Sets the value for a header field to be sent with all requests. |
public void | setMainWindow(WebWindow mainWindow) |
public void | setProxyServer(String proxyHost, int proxyPort) Specifies a proxy server to use for requests from this client. |
public void | setProxyServer(String proxyHost, int proxyPort, String userName, String password) Specifies a proxy server to use, along with a user and password for authentication. |
public void | setUserAgent(String userAgent) Specifies the user agent identification. |
void | tellListeners(WebRequest request) |
void | tellListeners(WebResponse response) |
void | updateClient(WebResponse response) |
void | updateFrameContents(WebWindow requestWindow, String requestTarget, WebResponse response, RequestContext requestContext) |
final protected void | updateMainWindow(FrameSelector frame, WebResponse response) Updates this web client based on a received response. |
final protected void | writeMessageBody(WebRequest request, OutputStream stream) Writes the message body for the request. |