org.owasp.webscarab.httpclient
Class URLFetcher

java.lang.Object
  extended by org.owasp.webscarab.httpclient.URLFetcher
All Implemented Interfaces:
HTTPClient

public class URLFetcher
extends java.lang.Object
implements HTTPClient

Creates a new instance of URLFetcher

Author:
rdawes

Constructor Summary
URLFetcher()
          Creates a new instance of URLFetcher
 
Method Summary
 Response fetchResponse(Request request)
          Can be used by a calling class to fetch a request without spawning an additional thread.
 Authenticator getAuthenticator()
           
 void setAuthenticator(Authenticator authenticator)
           
 void setHttpProxy(java.lang.String proxy, int proxyport)
          Tells URLFetcher which HTTP proxy to use, if any
 void setHttpsProxy(java.lang.String proxy, int proxyport)
          Tells URLFetcher which HTTPS proxy to use, if any
 void setNoProxy(java.lang.String[] noproxy)
          Accepts an array of hostnames or domains for which no proxy should be used.
 void setSSLContextManager(SSLContextManager sslContextManager)
           
 void setTimeouts(int connectTimeout, int readTimeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLFetcher

public URLFetcher()
Creates a new instance of URLFetcher

Method Detail

setHttpProxy

public void setHttpProxy(java.lang.String proxy,
                         int proxyport)
Tells URLFetcher which HTTP proxy to use, if any

Parameters:
proxy - The address or name of the proxy server to use for HTTP requests
proxyport - The port on the proxy server to connect to

setHttpsProxy

public void setHttpsProxy(java.lang.String proxy,
                          int proxyport)
Tells URLFetcher which HTTPS proxy to use, if any

Parameters:
proxy - The address or name of the proxy server to use for HTTPS requests
proxyport - The port on the proxy server to connect to

setNoProxy

public void setNoProxy(java.lang.String[] noproxy)
Accepts an array of hostnames or domains for which no proxy should be used. if the hostname begins with a period ("."), than all hosts in that domain will ignore the configured proxies

Parameters:
noproxy - An array of hosts or domains for which no proxy should be used. Domains must start with a period (".")

setSSLContextManager

public void setSSLContextManager(SSLContextManager sslContextManager)

setTimeouts

public void setTimeouts(int connectTimeout,
                        int readTimeout)

setAuthenticator

public void setAuthenticator(Authenticator authenticator)

getAuthenticator

public Authenticator getAuthenticator()

fetchResponse

public Response fetchResponse(Request request)
                       throws java.io.IOException
Can be used by a calling class to fetch a request without spawning an additional thread. This is appropriate when the calling class is already running in an independant thread, and must wait for the response before continuing.

Specified by:
fetchResponse in interface HTTPClient
Parameters:
request - the request to retrieve.
Returns:
the retrieved response
Throws:
java.io.IOException