use of org.netbeans.lib.cvsclient.command.IOCommandException in project intellij-community by JetBrains.
the class CreateModuleCommand method execute.
// Implemented ============================================================
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException, AuthenticationException {
// check necessary fields
BugLog.getInstance().assertNotNull(module);
final String repositoryRoot = FileUtils.removeTrailingSlash(clientEnvironment.getCvsRoot().getRepositoryPath()) + '/' + module;
final Requests requests = new Requests(CommandRequest.IMPORT, clientEnvironment);
requests.addArgumentRequest("-b");
requests.addArgumentRequest("1.1.1");
requests.addMessageRequests("Create module");
requests.addArgumentRequest(module);
requests.addArgumentRequest("vendor-tag");
requests.addArgumentRequest("release-tag");
requests.addRequest(new DirectoryRequest(".", repositoryRoot));
if (!requestProcessor.processRequests(requests, new DummyRequestsProgressHandler())) {
return false;
}
try {
createCvsDirectory(clientEnvironment, repositoryRoot);
} catch (IOException ex) {
throw new IOCommandException(ex);
}
return true;
}
use of org.netbeans.lib.cvsclient.command.IOCommandException in project intellij-community by JetBrains.
the class ExtConnectionCvsSettings method processException.
@Override
public CommandException processException(CommandException t) {
Exception sourceException = t.getUnderlyingException();
if (!(sourceException instanceof IOException))
return t;
String localizedMessage = t.getLocalizedMessage();
if (localizedMessage == null || !localizedMessage.startsWith(UNHANDLED_RESPONSE_PREFIX))
return t;
String response = localizedMessage.substring(UNHANDLED_RESPONSE_PREFIX.length(), localizedMessage.length() - 1);
if (StringUtil.startsWithConcatenation(response, USER, "@", HOST)) {
return new IOCommandException(new IOException(CvsBundle.message("exception.text.ext.server.rejected.access")));
} else {
return new IOCommandException(new IOException(CvsBundle.message("exception.text.cannot.establish.external.connection", response)));
}
}
Aggregations