public class HttpClientHelper extends Object
RemoteClient but not available externally)
This class also provides support for creating proxy configurations,
taking into account System properties like:
| Constructor and Description |
|---|
HttpClientHelper() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.commons.httpclient.Credentials |
createProxyCredentials(String proxyUserProperty,
String proxyPasswordProperty)
Create the proxy credentials for the given proxy user and password properties.
|
static org.apache.commons.httpclient.ProxyHost |
createProxyHost(String hostProperty,
String portProperty,
int defaultPort)
Create proxy host for the given system host and port properties.
|
static org.apache.commons.httpclient.HttpClient |
getHttpClient()
Returns an initialised HttpClient instance for the current thread, which
will have been configured for optimal settings
|
static boolean |
requiresProxy(String targetHost)
Return true unless the given target host is specified in the
http.nonProxyHosts system property (used for both protocols, http and https). |
public static org.apache.commons.httpclient.HttpClient getHttpClient()
public static org.apache.commons.httpclient.ProxyHost createProxyHost(String hostProperty, String portProperty, int defaultPort)
hostProperty - the name of the system property for the proxy server (http.proxyHost or https.proxyHost)portProperty - the name of the system property for the proxy server port (http.proxyPort or https.proxyPort)defaultPort - public static org.apache.commons.httpclient.Credentials createProxyCredentials(String proxyUserProperty, String proxyPasswordProperty)
proxyUserProperty - the name of the system property for the proxy userproxyPasswordProperty - the name of the system property for the proxy passwordpublic static boolean requiresProxy(String targetHost)
http.nonProxyHosts system property (used for both protocols, http and https).
See Networking Properties.targetHost - Non-null host name to verifyCopyright © 2005–2018 Alfresco Software. All rights reserved.