use of org.apache.maven.scm.command.list.ListScmResult in project maven-scm by apache.
the class SvnListCommand method executeListCommand.
/**
* {@inheritDoc}
*/
protected ListScmResult executeListCommand(ScmProviderRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version) throws ScmException {
Commandline cl = createCommandLine((SvnScmProviderRepository) repository, fileSet, recursive, version);
SvnListConsumer consumer = new SvnListConsumer();
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
if (getLogger().isInfoEnabled()) {
getLogger().info("Executing: " + SvnCommandLineUtils.cryptPassword(cl));
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
getLogger().info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
}
int exitCode;
try {
exitCode = SvnCommandLineUtils.execute(cl, consumer, stderr, getLogger());
} catch (CommandLineException ex) {
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());
}
use of org.apache.maven.scm.command.list.ListScmResult in project maven-scm by apache.
the class TfsListCommand method executeListCommand.
protected ListScmResult executeListCommand(ScmProviderRepository r, ScmFileSet f, boolean recursive, ScmVersion v) throws ScmException {
FileListConsumer out = new ServerFileListConsumer();
ErrorStreamConsumer err = new ErrorStreamConsumer();
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());
}
Aggregations