Package org.apache.maven.wagon.proxy

Examples of org.apache.maven.wagon.proxy.ProxyInfo


                    NetworkProxyConfiguration networkProxyConfig = archivaConfiguration.getConfiguration().getNetworkProxiesAsMap().get(
                        proxyConnector.getProxyId() );

                    if( networkProxyConfig != null )
                    {
                        ProxyInfo proxy = new ProxyInfo();
                        proxy.setType( networkProxyConfig.getProtocol() );
                        proxy.setHost( networkProxyConfig.getHost() );
                        proxy.setPort( networkProxyConfig.getPort() );
                        proxy.setUserName( networkProxyConfig.getUsername() );
                        proxy.setPassword( networkProxyConfig.getPassword() );

                        // key/value: remote repo ID/proxy info
                        networkProxies.put( proxyConnector.getTargetRepoId(), proxy );
                    }
                }
View Full Code Here


                    NetworkProxyConfiguration networkProxyConfig = archivaConfiguration.getConfiguration().getNetworkProxiesAsMap().get(
                        proxyConnector.getProxyId() );

                    if( networkProxyConfig != null )
                    {
                        ProxyInfo proxy = new ProxyInfo();
                        proxy.setType( networkProxyConfig.getProtocol() );
                        proxy.setHost( networkProxyConfig.getHost() );
                        proxy.setPort( networkProxyConfig.getPort() );
                        proxy.setUserName( networkProxyConfig.getUsername() );
                        proxy.setPassword( networkProxyConfig.getPassword() );

                        // key/value: remote repo ID/proxy info
                        networkProxies.put( proxyConnector.getTargetRepoId(), proxy );
                    }
                }
View Full Code Here

     */
    private boolean connectToRepository( Wagon wagon, RemoteRepositoryConfiguration remoteRepository )
    {
        boolean connected;

        final ProxyInfo networkProxy;
        networkProxy = this.networkProxyMap.get( remoteRepository.getId() );

        if ( networkProxy != null )
        {
            String msg =
                "Using network proxy " + networkProxy.getHost() + ":" + networkProxy.getPort()
                    + " to connect to remote repository " + remoteRepository.getUrl();
            if ( networkProxy.getNonProxyHosts() != null )
            {
                msg += "; excluding hosts: " + networkProxy.getNonProxyHosts();
            }

            if ( StringUtils.isNotBlank( networkProxy.getUserName() ) )
            {
                msg += "; as user: " + networkProxy.getUserName();
            }

            log.debug( msg );
        }

View Full Code Here

        }
    }

    public ProxyInfo getProxy( String protocol )
    {
        ProxyInfo info = (ProxyInfo) proxies.get( protocol );
       
        if ( info != null )
        {
            getLogger().debug( "Using Proxy: " + info.getHost() );
        }
       
        return info;
    }
View Full Code Here

                          int port,
                          String username,
                          String password,
                          String nonProxyHosts )
    {
        ProxyInfo proxyInfo = new ProxyInfo();
        proxyInfo.setHost( host );
        proxyInfo.setType( protocol );
        proxyInfo.setPort( port );
        proxyInfo.setNonProxyHosts( nonProxyHosts );
        proxyInfo.setUserName( username );
        proxyInfo.setPassword( password );

        proxies.put( protocol, proxyInfo );
    }
View Full Code Here

        if ( settings != null && settings.getActiveProxy() != null )
        {
            Proxy activeProxy = settings.getActiveProxy();

            ProxyInfo proxyInfo = new ProxyInfo();
            proxyInfo.setNonProxyHosts( activeProxy.getNonProxyHosts() );

            if ( StringUtils.isNotEmpty( activeProxy.getHost() )
                 && ( url == null || !ProxyUtils.validateNonProxyHosts( proxyInfo, url.getHost() ) ) )
            {
                HttpHost proxy = new HttpHost(activeProxy.getHost(), activeProxy.getPort());
View Full Code Here

    }

    protected void openConnectionInternal()
        throws ConnectionException, AuthenticationException
    {
        final ProxyInfo proxyInfo = getProxyInfo( "http", getRepository().getHost() );
        if ( proxyInfo != null )
        {
            this.proxy = getProxy( proxyInfo );
        }
        authenticator.setWagon( this );
View Full Code Here

    }

    public void testProxiedRequest()
        throws Exception
    {
        ProxyInfo proxyInfo = createProxyInfo();
        TestHeaderHandler handler = new TestHeaderHandler();

        runTestProxiedRequest( proxyInfo, handler );
    }
View Full Code Here

    }

    public void testProxiedRequestWithAuthentication()
        throws Exception
    {
        ProxyInfo proxyInfo = createProxyInfo();
        proxyInfo.setUserName( "user" );
        proxyInfo.setPassword( "secret" );
        AuthorizingProxyHandler handler = new AuthorizingProxyHandler();

        runTestProxiedRequest( proxyInfo, handler );

        assertTrue( handler.headers.containsKey( "Proxy-Authorization" ) );
View Full Code Here

        }
    }

    private ProxyInfo createProxyInfo()
    {
        ProxyInfo proxyInfo = new ProxyInfo();
        proxyInfo.setHost( "localhost" );
        proxyInfo.setNonProxyHosts( null );
        proxyInfo.setType( "http" );
        return proxyInfo;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.wagon.proxy.ProxyInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.