use of org.apache.maven.scm.command.Command in project maven-scm by apache.
the class AbstractCvsMkdirCommand method executeMkdirCommand.
/**
* {@inheritDoc}
*/
protected MkdirScmResult executeMkdirCommand(ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean createInLocal) throws ScmException {
CommandParameters parameters = new CommandParameters();
parameters.setString(CommandParameter.MESSAGE, message == null ? "" : message);
parameters.setString(CommandParameter.BINARY, "false");
// just invoke add command
Command cmd = getAddCommand();
cmd.setLogger(getLogger());
ScmResult addResult = cmd.execute(repository, fileSet, parameters);
if (!addResult.isSuccess()) {
return new MkdirScmResult(addResult.getCommandLine().toString(), "The cvs command failed.", addResult.getCommandOutput(), false);
}
List<ScmFile> addedFiles = new ArrayList<ScmFile>();
for (File file : fileSet.getFileList()) {
ScmFile scmFile = new ScmFile(file.getPath(), ScmFileStatus.ADDED);
addedFiles.add(scmFile);
}
return new MkdirScmResult(addResult.getCommandLine().toString(), addedFiles);
}
Aggregations