com.taleo.integration.client.customstep.util
Class HttpUtils

java.lang.Object
  extended by com.taleo.integration.client.customstep.util.HttpUtils

public final class HttpUtils
extends java.lang.Object

Utility class for HTTP clients.

Author:
Romain Guay, Oracle Corporation

Constructor Summary
HttpUtils()
           
 
Method Summary
static org.apache.commons.httpclient.UsernamePasswordCredentials createProxyCredentials(java.lang.String pUserName, java.lang.String pPassword)
          Creates the correct instance of credentials based on the proxy parameters set in the current JVM.
static org.apache.commons.httpclient.HttpClient getHttpClient()
          Creates a HTTP client instance for the communication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpUtils

public HttpUtils()
Method Detail

getHttpClient

public static org.apache.commons.httpclient.HttpClient getHttpClient()
Creates a HTTP client instance for the communication. The protocol and host are used to determine whether to communication through a HTTP proxy, based on the standard JVM settings.

Returns:
The created httpClient

createProxyCredentials

public static org.apache.commons.httpclient.UsernamePasswordCredentials createProxyCredentials(java.lang.String pUserName,
                                                                                               java.lang.String pPassword)
Creates the correct instance of credentials based on the proxy parameters set in the current JVM. This credential is to be used when trying to authenticate using a proxy.

Parameters:
pUserName - The user name to use for the credentials
pPassword - The password for that user
Returns:
The newly created instance of credentials to use for the proxy.