public class UrlFetcher
extends java.lang.Object
| Constructor and Description |
|---|
UrlFetcher() |
| Modifier and Type | Method and Description |
|---|---|
UrlFetcher |
addHeader(java.lang.String name,
java.lang.String value)
Adds a new parameter to this URL fetcher.
|
UrlFetcher |
addParam(java.lang.String name,
java.lang.String value)
Adds a new parameter to this URL fetcher.
|
UrlResponse |
execute()
Executes the fetching logic.
|
java.lang.String |
getQueryString()
Gets query string of parameters.
|
UrlFetcher |
setConnectTimeout(int theConnectTimeout)
Specifies connect timeout to this URL fetcher.
|
UrlFetcher |
setReadTimeout(int theReadTimeout)
Specifies read timeout to this URL fetcher.
|
UrlFetcher |
setRequestMethod(RequestMethod theRequestMethod)
Specifies request method to this URL fetcher.
|
UrlFetcher |
setUrl(java.lang.String theUrl)
Specifies URL to this URL fetcher.
|
public final UrlFetcher setUrl(java.lang.String theUrl)
theUrl - The URL specified.public final UrlFetcher setReadTimeout(int theReadTimeout)
theReadTimeout - The read timeout specified.public final UrlFetcher setConnectTimeout(int theConnectTimeout)
theConnectTimeout - The connect timeout specified.public final UrlFetcher setRequestMethod(RequestMethod theRequestMethod)
theRequestMethod - The request method specified.public final UrlFetcher addHeader(java.lang.String name, java.lang.String value)
name - The parameter name specified.value - The parameter value specified.public final UrlFetcher addParam(java.lang.String name, java.lang.String value)
name - The parameter name specified.value - The parameter value specified.public final UrlResponse execute() throws java.io.IOException
java.io.IOException - If IO errors occur.public final java.lang.String getQueryString()
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException - If encoding errors occur.