else
{
proxyInfo = getProxyInfo( ProxyInfo.PROXY_HTTP, getRepository().getHost() );
if ( proxyInfo != null && proxyInfo.getHost() != null )
{
proxy = new ProxyHTTP( proxyInfo.getHost(), proxyInfo.getPort() );
( (ProxyHTTP) proxy ).setUserPasswd( proxyInfo.getUserName(), proxyInfo.getPassword() );
}
else
{
// Backwards compatibility
proxyInfo = getProxyInfo( getRepository().getProtocol(), getRepository().getHost() );
if ( proxyInfo != null && proxyInfo.getHost() != null )
{
// if port == 1080 we will use SOCKS5 Proxy, otherwise will use HTTP Proxy
if ( proxyInfo.getPort() == SOCKS5_PROXY_PORT )
{
proxy = new ProxySOCKS5( proxyInfo.getHost(), proxyInfo.getPort() );
( (ProxySOCKS5) proxy ).setUserPasswd( proxyInfo.getUserName(), proxyInfo.getPassword() );
}
else
{
proxy = new ProxyHTTP( proxyInfo.getHost(), proxyInfo.getPort() );
( (ProxyHTTP) proxy ).setUserPasswd( proxyInfo.getUserName(), proxyInfo.getPassword() );
}
}
}
}