Examples of ErrorStreamConsumer


Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

        throws ScmException
    {
        TfsCommand command = createCommand( r, f, tag, scmTagParameters );

        StringStreamConsumer out = new StringStreamConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();

        int status = command.execute( out, err );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new TagScmResult( command.getCommandString(), "Error code for TFS label command - " + status,
                                     err.getOutput(), false );
        }
        List<ScmFile> files = new ArrayList<ScmFile>(f.getFileList().size());
        for (File file : f.getFileList() )
        {
            files.add( new ScmFile( file.getPath(), ScmFileStatus.TAGGED ) );
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

        throws ScmException
    {

        TfsCommand command = createCommand( r, f, m );
        FileListConsumer fileConsumer = new FileListConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();
       
        int status = command.execute( fileConsumer, err );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new CheckInScmResult( command.getCommandString(), "Error code for TFS checkin command - " + status,
                                         err.getOutput(), false );
        }
        return new CheckInScmResult( command.getCommandString(), fileConsumer.getFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

    protected ScmResult executeUnEditCommand( ScmProviderRepository r, ScmFileSet f )
        throws ScmException
    {
        FileListConsumer out = new FileListConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();
        TfsCommand command = createCommand( r, f );
        int status = command.execute( out, err );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new UnEditScmResult( command.getCommandString(), "Error code for TFS unedit command - " + status,
                                        err.getOutput(), false );
        }
        return new UnEditScmResult( command.getCommandString(), out.getFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

    protected CheckInScmResult executeCheckInCommand( ScmProviderRepository r, ScmFileSet f, String m, ScmVersion v )
        throws ScmException
    {
        TfsCommand command = createCommand( r, f, m );
        FileListConsumer fileConsumer = new FileListConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();

        int status = command.execute( fileConsumer, err );
        getLogger().debug( "status of checkin command is= " + status + "; err= " + err.getOutput() );

        //[SCM-753] support TFS checkin-policies - TFS returns error, that can be ignored.
        if ( err.hasBeenFed() && err.getOutput().startsWith( TFS_CHECKIN_POLICIES_ERROR ) )
        {
            getLogger().debug( "exclusion: got error " + TFS_CHECKIN_POLICIES_ERROR
                                   + " due to checkin policies. Ignoring it..." );
        }

        if ( status != 0 || ( err.hasBeenFed() && !err.getOutput().startsWith( TFS_CHECKIN_POLICIES_ERROR ) ) )
        {
            getLogger().error( "ERROR in command: " + command.getCommandString()
                                   + "; Error code for TFS checkin command - " + status );
            return new CheckInScmResult( command.getCommandString(), "Error code for TFS checkin command - " + status,
                                         err.getOutput(), false );
        }
        return new CheckInScmResult( command.getCommandString(), fileConsumer.getFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

        if ( workspaceProvided )
        {
            status = executeUnmapCommand( r, f );
        }
       
        ErrorStreamConsumer out = new ErrorStreamConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();
        if ( workspaceProvided )
        {
            command = new TfsCommand( "workfold", r, null, getLogger() );
            command.addArgument( "-workspace:" + workspace );
            command.addArgument( "-map" );
            command.addArgument( url );
            command.addArgument( f.getBasedir().getAbsolutePath() );
            status = command.execute( out, err );
            if ( status != 0 || err.hasBeenFed() )
            {
                return new CheckOutScmResult( command.getCommandString(),
                                              "Error code for TFS checkout (workfold map) command - " + status,
                                              err.getOutput(), false );
            }
        }
        FileListConsumer fileConsumer = new FileListConsumer();
        err = new ErrorStreamConsumer();
        command = createGetCommand( r, f, v, recursive );
        status = command.execute( fileConsumer, err );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new CheckOutScmResult( command.getCommandString(), "Error code for TFS checkout (get) command - "
                + status, err.getOutput(), false );
        }
       
        return new CheckOutScmResult( command.getCommandString(), fileConsumer.getFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

        throws ScmException
    {
        TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r;
        String url = tfsRepo.getServerPath();
        String workspace = tfsRepo.getWorkspace();
        ErrorStreamConsumer out = new ErrorStreamConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();
       
        TfsCommand command = new TfsCommand( "workfold", r, null, getLogger() );
        command.addArgument( "-workspace:" + workspace );
        command.addArgument( "-unmap" );
        command.addArgument( url );
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

    }

    private void createWorkspace( ScmProviderRepository r, ScmFileSet f, String workspace, String url )
        throws ScmException
    {
        ErrorStreamConsumer out = new ErrorStreamConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();
        // Checkout dir may not exist yet
        TfsCommand command = new TfsCommand( "workspace", r, null, getLogger() );
        command.addArgument( "-new" );
        command.addArgument( "-comment:Creating workspace for maven command" );
        command.addArgument( "-server:" + url );
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

        throws ScmException
    {
        TfsCommand command = createCommand( r, f, tag, scmTagParameters );

        StringStreamConsumer out = new StringStreamConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();

        int status = command.execute( out, err );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new TagScmResult( command.getCommandString(), "Error code for TFS label command - " + status,
                                     err.getOutput(), false );
        }
        List<ScmFile> files = new ArrayList<ScmFile>( f.getFileList().size() );
        for ( File file : f.getFileList() )
        {
            files.add( new ScmFile( file.getPath(), ScmFileStatus.TAGGED ) );
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

    protected CheckInScmResult executeCheckInCommand( ScmProviderRepository r, ScmFileSet f, String m, ScmVersion v )
        throws ScmException
    {
        TfsCommand command = createCommand( r, f, m );
        FileListConsumer fileConsumer = new FileListConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();

        int status = command.execute( fileConsumer, err );
        getLogger().debug( "status of checkin command is= " + status + "; err= " + err.getOutput() );

        //[SCM-753] support TFS checkin-policies - TFS returns error, that can be ignored.
        if ( err.hasBeenFed() && err.getOutput().startsWith( TFS_CHECKIN_POLICIES_ERROR ) )
        {
            getLogger().debug( "exclusion: got error " + TFS_CHECKIN_POLICIES_ERROR
                                   + " due to checkin policies. Ignoring it..." );
        }

        if ( status != 0 || ( err.hasBeenFed() && !err.getOutput().startsWith( TFS_CHECKIN_POLICIES_ERROR ) ) )
        {
            getLogger().error( "ERROR in command: " + command.getCommandString()
                                   + "; Error code for TFS checkin command - " + status );
            return new CheckInScmResult( command.getCommandString(), "Error code for TFS checkin command - " + status,
                                         err.getOutput(), false );
        }
        return new CheckInScmResult( command.getCommandString(), fileConsumer.getFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer

    protected ScmResult executeUnEditCommand( ScmProviderRepository r, ScmFileSet f )
        throws ScmException
    {
        FileListConsumer out = new FileListConsumer();
        ErrorStreamConsumer err = new ErrorStreamConsumer();
        TfsCommand command = createCommand( r, f );
        int status = command.execute( out, err );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new UnEditScmResult( command.getCommandString(), "Error code for TFS unedit command - " + status,
                                        err.getOutput(), false );
        }
        return new UnEditScmResult( command.getCommandString(), out.getFiles() );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.