clientParams.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
String proxyUser = getProxyUser();
if (proxyUser.length() > 0) {
((AbstractHttpClient) httpClient).getCredentialsProvider().setCredentials(
new AuthScope(proxyHost, proxyPort),
new UsernamePasswordCredentials(proxyUser, getProxyPass()));
}
} else if (useStaticProxy) {
HttpHost proxy = new HttpHost(PROXY_HOST, PROXY_PORT);
clientParams.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
if (PROXY_USER.length() > 0)
((AbstractHttpClient) httpClient).getCredentialsProvider().setCredentials(
new AuthScope(PROXY_HOST, PROXY_PORT),
new UsernamePasswordCredentials(PROXY_USER, PROXY_PASS));
}
if (log.isDebugEnabled()) {
log.debug("Created new HttpClient: @"+System.identityHashCode(httpClient));
}