|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.bvalid.util.WebClient
public class WebClient
A general-purpose, connection-pooling HTTP Client. All methods are thread-safe. Provides option for client to handle HTTP redirects
Field Summary | |
---|---|
boolean |
FOLLOW_REDIRECTS
Whether to automatically follow HTTP redirects. |
int |
MAX_CONNECTIONS_PER_HOST
Maxiumum http connections per host |
int |
MAX_REDIRECTS
Maximum number of redirects to follow per request if FOLLOW_REDIRECTS is true. |
int |
MAX_TOTAL_CONNECTIONS
Maxiumum total http connections |
int |
SOCKET_TIMEOUT_SECONDS
Seconds to wait while waiting for data over the socket (SO_TIMEOUT). |
int |
TIMEOUT_SECONDS
Seconds to wait before a connection is established. |
java.lang.String |
USER_AGENT
What the "User-Agent" request header should say. |
Constructor Summary | |
---|---|
WebClient()
|
Method Summary | |
---|---|
HttpInputStream |
get(java.lang.String url,
boolean failIfNotOK)
|
HttpInputStream |
get(java.lang.String url,
boolean failIfNotOK,
java.lang.String user,
java.lang.String pass)
|
HttpInputStream |
get(java.lang.String url,
boolean failIfNotOK,
org.apache.commons.httpclient.UsernamePasswordCredentials creds)
Get an HTTP resource with the response as an InputStream, given a URL. |
org.apache.commons.httpclient.HttpClient |
getHttpClient()
|
org.apache.commons.httpclient.HttpClient |
getHttpClient(java.lang.String hostOrURL,
org.apache.commons.httpclient.UsernamePasswordCredentials creds)
|
java.lang.String |
getResponseAsString(java.lang.String url,
boolean failIfNotOK)
|
java.lang.String |
getResponseAsString(java.lang.String url,
boolean failIfNotOK,
org.apache.commons.httpclient.UsernamePasswordCredentials creds)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int TIMEOUT_SECONDS
public int SOCKET_TIMEOUT_SECONDS
public int MAX_CONNECTIONS_PER_HOST
public int MAX_TOTAL_CONNECTIONS
public boolean FOLLOW_REDIRECTS
public int MAX_REDIRECTS
public java.lang.String USER_AGENT
Constructor Detail |
---|
public WebClient()
Method Detail |
---|
public org.apache.commons.httpclient.HttpClient getHttpClient() throws java.io.IOException
java.io.IOException
public org.apache.commons.httpclient.HttpClient getHttpClient(java.lang.String hostOrURL, org.apache.commons.httpclient.UsernamePasswordCredentials creds) throws java.io.IOException
java.io.IOException
public HttpInputStream get(java.lang.String url, boolean failIfNotOK) throws java.io.IOException
java.io.IOException
public HttpInputStream get(java.lang.String url, boolean failIfNotOK, java.lang.String user, java.lang.String pass) throws java.io.IOException
java.io.IOException
public HttpInputStream get(java.lang.String url, boolean failIfNotOK, org.apache.commons.httpclient.UsernamePasswordCredentials creds) throws java.io.IOException
url
- A URL that we want to do an HTTP GET uponfailIfNotOK
- boolean value indicating if an exception should be thrown
if we do NOT receive an HTTP 200 response (OK)
java.io.IOException
public java.lang.String getResponseAsString(java.lang.String url, boolean failIfNotOK) throws java.io.IOException
java.io.IOException
public java.lang.String getResponseAsString(java.lang.String url, boolean failIfNotOK, org.apache.commons.httpclient.UsernamePasswordCredentials creds) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |