use of org.apache.maven.scm.provider.integrity.Sandbox in project maven-scm by apache.
the class IntegrityRemoveCommand method executeRemoveCommand.
/**
* {@inheritDoc}
*/
@Override
public RemoveScmResult executeRemoveCommand(ScmProviderRepository repository, ScmFileSet fileSet, String message) throws ScmException {
getLogger().info("Attempting to un-register sandbox in directory " + fileSet.getBasedir().getAbsolutePath());
RemoveScmResult result;
IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
try {
Sandbox siSandbox = iRepo.getSandbox();
Response res = siSandbox.drop();
int exitCode = res.getExitCode();
boolean success = (exitCode == 0 ? true : false);
result = new RemoveScmResult(res.getCommandString(), "", "Exit Code: " + exitCode, success);
} catch (APIException aex) {
ExceptionHandler eh = new ExceptionHandler(aex);
getLogger().error("MKS API Exception: " + eh.getMessage());
getLogger().info(eh.getCommand() + " exited with return code " + eh.getExitCode());
result = new RemoveScmResult(eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false);
}
return result;
}
Aggregations