Search in sources :

Example 1 with ProxyInfoProvider

use of org.apache.maven.wagon.proxy.ProxyInfoProvider in project sonatype-aether by sonatype.

the class WagonRepositoryConnector method getProxy.

private ProxyInfoProvider getProxy(RemoteRepository repository) {
    ProxyInfoProvider proxy = null;
    Proxy p = repository.getProxy();
    if (p != null) {
        final ProxyInfo prox = new ProxyInfo();
        prox.setType(p.getType());
        prox.setHost(p.getHost());
        prox.setPort(p.getPort());
        if (p.getAuthentication() != null) {
            prox.setUserName(p.getAuthentication().getUsername());
            prox.setPassword(p.getAuthentication().getPassword());
        }
        proxy = new ProxyInfoProvider() {

            public ProxyInfo getProxyInfo(String protocol) {
                return prox;
            }
        };
    }
    return proxy;
}
Also used : ProxyInfoProvider(org.apache.maven.wagon.proxy.ProxyInfoProvider) ProxyInfo(org.apache.maven.wagon.proxy.ProxyInfo) Proxy(org.sonatype.aether.repository.Proxy)

Aggregations

ProxyInfo (org.apache.maven.wagon.proxy.ProxyInfo)1 ProxyInfoProvider (org.apache.maven.wagon.proxy.ProxyInfoProvider)1 Proxy (org.sonatype.aether.repository.Proxy)1