Package org.apache.maven.scm.command.list

Examples of org.apache.maven.scm.command.list.ListScmResult


        {
            ScmRepository repository = getScmRepository( getRepository().getUrl() );

            ScmProvider provider = getScmProvider( repository.getProvider() );

            ListScmResult result =
                provider.list( repository, new ScmFileSet( new File( "." ), new File( resourcePath ) ), false,
                               makeScmVersion() );

            if ( !result.isSuccess() )
            {
                throw new ResourceDoesNotExistException( result.getProviderMessage() );
            }

            List<String> files = new ArrayList<String>();

            for ( ScmFile f : result.getFiles() )
            {
                files.add( f.getPath() );
            }

            return files;
View Full Code Here


    public List<String> getFileList(String resourcePath) throws TransferFailedException, ResourceDoesNotExistException,
        AuthorizationException {
        try {
            ScmRepository repository = getScmRepository(getRepository().getUrl());
            ScmProvider   provider   = getScmProvider(repository.getProvider());
            ListScmResult result     = provider.list(repository,
                                                     new ScmFileSet(new File("."), new File(resourcePath)), false, (ScmVersion) null);

            if (!result.isSuccess()) {
                throw new ResourceDoesNotExistException(result.getProviderMessage());
            }

            List<String> files = new ArrayList<String>();

            for (ScmFile f : getListScmResultFiles(result)) {
View Full Code Here

    @Override
    public ListScmResult executeListCommand( ScmProviderRepository repository, ScmFileSet fileSet, boolean recursive,
                                             ScmVersion scmVersion )
        throws ScmException
    {
        ListScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        getLogger().info( "Listing all files in project " + iRepo.getConfigruationPath() );
        try
        {
            // Get a listing for all the members in the project...
            List<Member> projectMembers = iRepo.getProject().listFiles( fileSet.getBasedir().getAbsolutePath() );
            // Initialize the list of ScmFile objects for the ListScmResult
            List<ScmFile> scmFileList = new ArrayList<ScmFile>();
            for ( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
            {
                Member siMember = it.next();
                scmFileList.add( new ScmFile( siMember.getTargetFilePath(), ScmFileStatus.UNKNOWN ) );
            }
            result = new ListScmResult( scmFileList, new ScmResult( "si viewproject", "", "", true ) );

        }
        catch ( APIException aex )
        {
            ExceptionHandler eh = new ExceptionHandler( aex );
            getLogger().error( "MKS API Exception: " + eh.getMessage() );
            getLogger().debug( eh.getCommand() + " exited with return code " + eh.getExitCode() );
            result = new ListScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
        }

        return result;
    }
View Full Code Here

       
        TfsCommand command = createCommand( r, f, recursive );
        int status = command.execute( out, err );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new ListScmResult( command.getCommandString(), "Error code for TFS list command - " + status,
                                      err.getOutput(), false );
        }
       
        return new ListScmResult( command.getCommandString(), out.getFiles() );
    }
View Full Code Here

            throw new ScmException( "Error while executing command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new ListScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
        }

        return new ListScmResult( cl.toString(), consumer.getFiles() );
    }
View Full Code Here

        ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, listCmd );

        if ( result.isSuccess() )
        {
            return new ListScmResult( consumer.getFiles(), result );
        }
        else
        {
            throw new ScmException( "Error while executing command " + cmd.toString() );
        }
View Full Code Here

        super.execute();

        try
        {
            ScmRepository repository = getScmRepository();
            ListScmResult result = getScmManager().list( repository, getFileSet(), recursive,
                                                         getScmVersion( scmVersionType, scmVersion ) );

            checkResult( result );

            if ( result.getFiles() != null )
            {
                for ( ScmFile scmFile : result.getFiles() )
                {
                    getLog().info( scmFile.getPath() );
                }
            }
        }
View Full Code Here

    {
        ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "/void" ) );

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );

        ListScmResult result = provider.list( getScmRepository(), fileSet, false, (ScmVersion) null );

        assertFalse( "Found file when shouldn't", result.isSuccess() );
    }
View Full Code Here

    private List<ScmFile> runList( ScmFileSet fileSet, boolean recursive )
        throws Exception
    {
        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );

        ListScmResult result = provider.list( getScmRepository(), fileSet, recursive, (ScmVersion) null );

        assertTrue( "SCM command failed: " + result.getCommandLine() + " : " + result.getProviderMessage()
            + ( result.getCommandOutput() == null ? "" : ": " + result.getCommandOutput() ), result.isSuccess() );

        return result.getFiles();
    }
View Full Code Here

                return new LocalListScmResult( null, files );
            }
        }
        catch ( Exception e )
        {
            return new ListScmResult( null, "The svn command failed.", e.getMessage(), false );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.command.list.ListScmResult

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.