use of org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer in project maven-scm by apache.
the class TfsCommand method execute.
public int execute(StreamConsumer out, ErrorStreamConsumer err) throws ScmException {
info("Command line - " + getCommandString());
int status;
try {
status = CommandLineUtils.executeCommandLine(command, out, err);
} catch (CommandLineException e) {
throw new ScmException("Error while executing TFS command line - " + getCommandString(), e);
}
info("err - " + err.getOutput());
if (out instanceof StringStreamConsumer) {
StringStreamConsumer sc = (StringStreamConsumer) out;
debug(sc.getOutput());
}
if (out instanceof FileListConsumer) {
FileListConsumer f = (FileListConsumer) out;
for (Iterator<ScmFile> i = f.getFiles().iterator(); i.hasNext(); ) {
ScmFile file = i.next();
debug(file.getPath());
}
}
return status;
}
use of org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer in project maven-scm by apache.
the class TfsCheckOutCommandTest method setUp.
protected void setUp() throws Exception {
super.setUp();
consumer = new FileListConsumer();
}
use of org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer in project maven-scm by apache.
the class TfsEditCommandTest method setUp.
protected void setUp() throws Exception {
super.setUp();
consumer = new FileListConsumer();
}
use of org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer in project maven-scm by apache.
the class TfsUpdateCommand method executeUpdateCommand.
protected UpdateScmResult executeUpdateCommand(ScmProviderRepository r, ScmFileSet f, ScmVersion v) throws ScmException {
FileListConsumer fileConsumer = new FileListConsumer();
ErrorStreamConsumer err = new ErrorStreamConsumer();
TfsCommand command = createCommand(r, f, v);
int status = command.execute(fileConsumer, err);
if (status != 0 || err.hasBeenFed()) {
return new UpdateScmResult(command.getCommandString(), "Error code for TFS update command - " + status, err.getOutput(), false);
}
return new UpdateScmResult(command.getCommandString(), fileConsumer.getFiles());
}
use of org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer in project maven-scm by apache.
the class TfsAddCommand method executeAddCommand.
protected ScmResult executeAddCommand(ScmProviderRepository r, ScmFileSet f, String m, boolean b) throws ScmException {
TfsCommand command = createCommand(r, f);
FileListConsumer fileConsumer = new FileListConsumer();
ErrorStreamConsumer err = new ErrorStreamConsumer();
int status = command.execute(fileConsumer, err);
if (status != 0 || err.hasBeenFed()) {
return new AddScmResult(command.getCommandString(), "Error code for TFS add command - " + status, err.getOutput(), false);
}
return new AddScmResult(command.getCommandString(), fileConsumer.getFiles());
}
Aggregations