Package org.codehaus.plexus.util

Examples of org.codehaus.plexus.util.StringInputStream


        if ( content != null )
        {
            resource.setContentLength( content.length() );
            resource.setLastModified( System.currentTimeMillis() );

            inputData.setInputStream( new StringInputStream( content ) );
        }
        else
        {
            throw new ResourceDoesNotExistException( "No content provided for " + resource.getName() );
        }
View Full Code Here


            try
            {
                String contents = getKnownHostsProvider().getContents();
                if ( contents != null )
                {
                    sch.setKnownHosts( new StringInputStream( contents ) );
                }
            }
            catch ( JSchException e )
            {
                // continue without known_hosts
View Full Code Here

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

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

    {
        StreamingWagon wagon = new TestWagon()
        {
            public void fillInputData( InputData inputData )
            {
                inputData.setInputStream( new StringInputStream( "" ) );
                inputData.getResource().setLastModified( resourceTime );
            }
        };

        File tempFile = File.createTempFile( "wagon", "tmp" );
View Full Code Here

        final long comparisonTime = new SimpleDateFormat( "yyyy-MM-dd" ).parse( "2008-01-01" ).getTime();
        StreamingWagon wagon = new TestWagon()
        {
            public void fillInputData( InputData inputData )
            {
                inputData.setInputStream( new StringInputStream( content ) );
                inputData.getResource().setLastModified( comparisonTime );
            }
        };

        wagon.connect( repository );
View Full Code Here

        final long comparisonTime = new SimpleDateFormat( "yyyy-MM-dd" ).parse( "2008-01-01" ).getTime();
        StreamingWagon wagon = new TestWagon()
        {
            public void fillInputData( InputData inputData )
            {
                inputData.setInputStream( new StringInputStream( content ) );
                inputData.getResource().setLastModified( comparisonTime );
            }
        };

        File tempFile = File.createTempFile( "wagon", "tmp" );
View Full Code Here

    {
        StreamingWagon wagon = new TestWagon()
        {
            public void fillInputData( InputData inputData )
            {
                inputData.setInputStream( new StringInputStream( "" ) );
                inputData.getResource().setLastModified( resourceTime );
            }
        };

        wagon.connect( repository );
View Full Code Here

        };

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

        };

        wagon.connect( repository );
        try
        {
            wagon.putFromStream( new StringInputStream( content ), "resource", content.length(), lastModified );
            assertEquals( content, out.toString() );
        }
        finally
        {
            wagon.disconnect();
View Full Code Here

TOP

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

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.