public class URLTask extends Task
URLTask
class holds additional properties for the Task
like proxy information. Additionally
it holds information on the response of URL execution like status code, http body etc.ChainedURLTask
,
Serialized FormConstructor and Description |
---|
URLTask(java.lang.String url) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBody()
Get the response body for the URL request.
|
java.lang.String |
getCompleteURL()
Get the full URL.
|
java.lang.String |
getHost()
Get the host from the URL.
|
java.lang.String |
getHostIPAddress()
Get the IP address of the host set by
InetSocketAddressCache . |
java.lang.String |
getPath()
Get the full URL path.
|
int |
getPort()
Get the port from the URL.
|
int |
getStatusCode()
Get the URL response code.
|
boolean |
isUseProxyServer()
Check if proxy is enabled.
|
void |
setBody(java.lang.String body)
Set the response body for the URL request.
|
void |
setHostIPAddress(java.lang.String hostIPAddress)
Set the IP address of the host.
|
void |
setStatusCode(int statusCode)
Set the HTTP status code from the URL response.
|
void |
setUseProxyServer(boolean useProxyServer)
Enable proxy for the request.
|
getErrorMsg, getLastTaskStatusUpdateTime, getStatus, getUrl, hasFailed, setErrorMsg, setLastTaskStatusUpdateTime, setStatus, setUrl
public void setStatusCode(int statusCode)
statusCode
- the URL response codepublic int getStatusCode()
public int getPort()
public java.lang.String getHost()
public java.lang.String getPath()
public java.lang.String getHostIPAddress()
InetSocketAddressCache
.setUseProxyServer(boolean)
. Or else host IP is returned.public void setHostIPAddress(java.lang.String hostIPAddress)
hostIPAddress
- the IP address of the host used to make connectionpublic boolean isUseProxyServer()
public void setUseProxyServer(boolean useProxyServer)
useProxyServer
- true if proxy enabledpublic java.lang.String getCompleteURL()
public java.lang.String getBody()
public void setBody(java.lang.String body)
body
- the response body for the URL request