use of com.intellij.openapi.ui.InputException in project intellij-community by JetBrains.
the class PServerSettingsPanel method saveTo.
public void saveTo(CvsApplicationLevelConfiguration config) {
final String pathToPasswordFile = CvsApplicationLevelConfiguration.convertToIOFilePath(myPathToPasswordFile.getText());
final File passwordFile = new File(pathToPasswordFile);
if (!passwordFile.exists()) {
final int result = Messages.showYesNoDialog(myPanel, CvsBundle.message("message.password.file.does.not.exist", pathToPasswordFile), CvsBundle.message("title.password.file.does.not.exist"), Messages.getQuestionIcon());
if (result == Messages.NO) {
throw new InputException(myPathToPasswordFile);
}
try {
passwordFile.createNewFile();
} catch (IOException e) {
throw new InputException(e.getMessage(), myPathToPasswordFile);
}
}
config.setPathToPasswordFile(pathToPasswordFile);
try {
final int timeout = Integer.parseInt(myTimeout.getText());
if (timeout < 0) {
throwInvalidTimeoutException();
}
config.TIMEOUT = timeout;
} catch (NumberFormatException ex) {
throwInvalidTimeoutException();
}
}
Aggregations