Package org.codehaus.plexus.util

Examples of org.codehaus.plexus.util.StringInputStream


     */
    public final static void main(String[] args) {
        StringBuffer builder = new StringBuffer();
        builder.append("<!ENTITY foo SYSTEM \"bar\">\n");
        builder.append("<!ENTITY bar SYSTEM \"foo\">\n");
        StringInputStream in = new StringInputStream(builder.toString());
        try {
            EntityFileParser.parse(in, new EntityVisitor() {

                public void visitSystemEntity(String name, String systemId) {
                    System.out.println("Name: " + name);
View Full Code Here


    private static Process createMockProcess( int exitCode )
    {
        Mock mockProcess = new Mock( Process.class );
        mockProcess.expects( new InvokeOnceMatcher() ).method( "getInputStream" ).will(
            new ReturnStub( new StringInputStream( "" ) ) );
        mockProcess.expects( new InvokeOnceMatcher() ).method( "getErrorStream" ).will(
            new ReturnStub( new StringInputStream( "" ) ) );
        mockProcess.expects( new InvokeOnceMatcher() ).method( "waitFor" ).will(
            new ReturnStub( new Integer( exitCode ) ) );
        if ( exitCode != 0 )
        {
            mockProcess.expects( new InvokeOnceMatcher() ).method( "exitValue" ).will(
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

        }

        StringOutputStream string = new StringOutputStream();
        confFile.save( string );

        Reader reader = new InputStreamReader( new StringInputStream( string.toString() ) );

        writeFilteredFile( request, daemon, reader, new File( outputDirectory, "conf/wrapper.conf" ), context );
    }
View Full Code Here

  public final static void main(String[] args) {
    StringBuffer builder = new StringBuffer();
    builder.append("<!ENTITY foo SYSTEM \"bar\">\n");
    builder.append("<!ENTITY bar SYSTEM \"foo\">\n");

    StringInputStream in = new StringInputStream(builder.toString());

    try {
      EntityFileParser.parse(in, new EntityVisitor() {
        public void visitSystemEntity(String name, String systemId) {
          System.out.println("Name: " + name);
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

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.