Package org.apache.maven.wagon.shared.http4

Examples of org.apache.maven.wagon.shared.http4.HttpMethodConfiguration


        try
        {
            HttpWagon wagon = (HttpWagon) getWagon();
            wagon.setHttpConfiguration(
                new HttpConfiguration().setAll( new HttpMethodConfiguration().setConnectionTimeout( 500 ) ) );

            Repository testRepository = new Repository();
            Random random = new Random( );
            testRepository.setUrl( "http://localhost:" + random.nextInt( 2048 ));
View Full Code Here


        return getProtocol() + "://localhost:" + getTestRepositoryPort();
    }

    protected void setHttpHeaders( StreamingWagon wagon, Properties properties )
    {
        HttpConfiguration config = new HttpConfiguration();

        HttpMethodConfiguration methodConfiguration = new HttpMethodConfiguration();
        methodConfiguration.setHeaders( properties );
        config.setAll( methodConfiguration );
        ( (HttpWagon) wagon ).setHttpConfiguration( config );
    }
View Full Code Here

    public void testSetPreemptiveAuthParamViaConfig()
    {
        HttpMethodConfiguration methodConfig = new HttpMethodConfiguration();
        //X TODO methodConfig.addParam( HttpClientParams.PREEMPTIVE_AUTHENTICATION, "%b,true" );

        HttpConfiguration config = new HttpConfiguration();
        config.setAll( methodConfig );

        TestWagon wagon = new TestWagon();
        wagon.setHttpConfiguration( config );

        HttpHead method = new HttpHead();
View Full Code Here

    {
        HttpMethodConfiguration methodConfig = new HttpMethodConfiguration();
        int maxRedirects = 2;
        methodConfig.addParam( ClientPNames.MAX_REDIRECTS, "%i," + maxRedirects );

        HttpConfiguration config = new HttpConfiguration();
        config.setAll( methodConfig );

        TestWagon wagon = new TestWagon();
        wagon.setHttpConfiguration( config );

        HttpHead method = new HttpHead();
View Full Code Here

        assertEquals( maxRedirects, params.getIntParameter( ClientPNames.MAX_REDIRECTS, -1 ) );
    }

    public void testDefaultHeadersUsedByDefault()
    {
        HttpConfiguration config = new HttpConfiguration();
        config.setAll( new HttpMethodConfiguration() );

        TestWagon wagon = new TestWagon();
        wagon.setHttpConfiguration( config );

        HttpHead method = new HttpHead();
View Full Code Here

        assertEquals( "gzip", header.getValue() );
    }

    public void testTurnOffDefaultHeaders()
    {
        HttpConfiguration config = new HttpConfiguration();
        config.setAll( new HttpMethodConfiguration().setUseDefaultHeaders( false ) );

        TestWagon wagon = new TestWagon();
        wagon.setHttpConfiguration( config );

        HttpHead method = new HttpHead();
View Full Code Here

    protected Wagon getWagon()
        throws Exception
    {
        HttpWagon wagon = (HttpWagon) super.getWagon();
        wagon.setHttpConfiguration(
            new HttpConfiguration().setAll( new HttpMethodConfiguration().setUsePreemptive( true ) ) );
        return wagon;
    }
View Full Code Here

        return getProtocol() + "://localhost:" + getTestRepositoryPort();
    }

    protected void setHttpHeaders( StreamingWagon wagon, Properties properties )
    {
        HttpConfiguration config = new HttpConfiguration();

        HttpMethodConfiguration methodConfiguration = new HttpMethodConfiguration();
        methodConfiguration.setHeaders( properties );
        config.setAll( methodConfiguration );
        ( (HttpWagon) wagon ).setHttpConfiguration( config );
    }
View Full Code Here

    protected Wagon getWagon()
        throws Exception
    {
        HttpWagon wagon = (HttpWagon) super.getWagon();
        wagon.setHttpConfiguration(
            new HttpConfiguration().setAll( new HttpMethodConfiguration().setUsePreemptive( true ) ) );
        return wagon;
    }
View Full Code Here

            wagon.setReadTimeout( timeoutInMilliseconds );
            wagon.setTimeout( timeoutInMilliseconds );

            if ( wagon instanceof AbstractHttpClientWagon )
            {
                HttpConfiguration httpConfiguration = new HttpConfiguration();
                HttpMethodConfiguration httpMethodConfiguration = new HttpMethodConfiguration();
                httpMethodConfiguration.setUsePreemptive( true );
                httpMethodConfiguration.setReadTimeout( timeoutInMilliseconds );
                httpConfiguration.setGet( httpMethodConfiguration );
                ( (AbstractHttpClientWagon) wagon ).setHttpConfiguration( httpConfiguration );
            }

            wagon.addTransferListener( new DownloadListener() );
            ProxyInfo proxyInfo = null;
View Full Code Here

TOP

Related Classes of org.apache.maven.wagon.shared.http4.HttpMethodConfiguration

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.