if (_config.getProxyConfig().getPort() != null) {
httpClientPolicy.setProxyServerPort(Integer.valueOf(_config.getProxyConfig().getPort()).intValue());
}
conduit.setClient(httpClientPolicy);
if (_config.getProxyConfig().getUser() != null) {
ProxyAuthorizationPolicy policy = new ProxyAuthorizationPolicy();
policy.setUserName(_config.getProxyConfig().getUser());
policy.setPassword(_config.getProxyConfig().getPassword());
conduit.setProxyAuthorization(policy);
}
}
if (_config.hasAuthentication()) {
AuthorizationPolicy policy = new AuthorizationPolicy();
// Set authentication
if (_config.isBasicAuth()) {
policy.setUserName(_config.getBasicAuthConfig().getUser());
policy.setPassword(_config.getBasicAuthConfig().getPassword());
policy.setAuthorizationType("Basic");
} else {
policy.setUserName(_config.getNtlmAuthConfig().getDomain() + "\\" + _config.getNtlmAuthConfig().getUser());
policy.setPassword(_config.getNtlmAuthConfig().getPassword());
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
if (timeout != null) {
httpClientPolicy.setConnectionTimeout(timeout);
} else {
httpClientPolicy.setConnectionTimeout(36000);