if (useDynamicProxy){
String user = getProxyUser();
if (user.length() > 0){
httpClient.getState().setProxyCredentials(
new AuthScope(proxyHost,proxyPort,null,AuthScope.ANY_SCHEME),
new NTCredentials(user,getProxyPass(),localHost,PROXY_DOMAIN)
);
} else {
httpClient.getState().clearProxyCredentials();
}
} else {
if (useStaticProxy) {
if (PROXY_USER.length() > 0){
httpClient.getState().setProxyCredentials(
new AuthScope(PROXY_HOST,PROXY_PORT,null,AuthScope.ANY_SCHEME),
new NTCredentials(PROXY_USER,PROXY_PASS,localHost,PROXY_DOMAIN)
);
}
} else {
httpClient.getState().clearProxyCredentials();
}