Package org.codehaus.plexus.util

Examples of org.codehaus.plexus.util.StringOutputStream


    public StreamKnownHostsProvider( InputStream stream )
        throws IOException
    {
        try
        {
            StringOutputStream stringOutputStream = new StringOutputStream();
            IOUtil.copy( stream, stringOutputStream );
            this.contents = stringOutputStream.toString();
           
            this.knownHosts = this.loadKnownHosts( this.contents );
        }
        finally
        {
View Full Code Here


    }

    public void fillOutputData( OutputData outputData )
        throws TransferFailedException
    {
        outputData.setOutputStream( new StringOutputStream() );
    }
View Full Code Here

        server.start();

        wagon.connect(
            new Repository( "id", getProtocol() + "://localhost:" + server.getConnectors()[0].getLocalPort() ) );

        wagon.getToStream( "resource", new StringOutputStream() );

        wagon.disconnect();

        server.stop();
View Full Code Here

        server.start();

        wagon.connect(
            new Repository( "id", getProtocol() + "://localhost:" + server.getConnectors()[0].getLocalPort() ) );

        wagon.getToStream( "resource", new StringOutputStream() );

        wagon.disconnect();

        server.stop();
View Full Code Here

        wagon.connect( new Repository( "id", getRepositoryUrl( server ) ) );

        try
        {
            wagon.getToStream( "resource", new StringOutputStream() );
            fail();
        }
        finally
        {
            wagon.disconnect();
View Full Code Here

            File sourceFile = new File( localRepositoryPath, "test-proxied-resource" );
            FileUtils.fileWrite( sourceFile.getAbsolutePath(), "content" );

            wagon.connect( testRepository, proxyInfo );

            StringOutputStream out = new StringOutputStream();
            try
            {
                wagon.getToStream( "test-proxied-resource", out );

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

            File sourceFile = new File( localRepositoryPath, "test-secured-resource" );
            FileUtils.fileWrite( sourceFile.getAbsolutePath(), "top secret" );

            wagon.connect( testRepository, authInfo );

            StringOutputStream out = new StringOutputStream();
            try
            {
                wagon.getToStream( "test-secured-resource", out );
            }
            finally
            {
                wagon.disconnect();
            }

            assertEquals( "top secret", out.toString() );

            TestSecurityHandler securityHandler = (TestSecurityHandler) ( (Context) server.getHandler() ).getHandler();
            testPreemptiveAuthenticationGet( securityHandler, supportPreemptiveAuthenticationGet() );
        }
        finally
View Full Code Here

        wagon.connect( repository );
        wagon.addTransferListener( listener );
        try
        {
            wagon.getToStream( "resource", new StringOutputStream() );
            fail();
        }
        catch ( TransferFailedException e )
        {
            assertTrue( true );
View Full Code Here

        wagon.connect( repository );
        wagon.addTransferListener( listener );
        try
        {
            wagon.getToStream( "resource", new StringOutputStream() );
            fail();
        }
        finally
        {
            wagon.disconnect();
View Full Code Here

        };

        wagon.connect( repository );
        try
        {
            StringOutputStream out = new StringOutputStream();
            wagon.getToStream( "resource", out );
            assertEquals( content, out.toString() );
        }
        finally
        {
            wagon.disconnect();
        }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.StringOutputStream

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.