summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java17
3 files changed, 19 insertions, 2 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java
index 0596f708..6dda2956 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java
@@ -278,7 +278,7 @@ public class KeystoreConfigurationComposite extends BaseConfigurationComposite {
} catch (FileNotFoundException ex) {
log.error("Error loading keystore", ex); //$NON-NLS-1$
showErrorDialog(String.format(Messages.getString(
- "error.FileNotExist"), f.getName())); //$NON-NLS-1$
+ "error.KeyStoreFileNotExist"), f.getName())); //$NON-NLS-1$
} catch (NoSuchAlgorithmException ex) {
log.error("Error loading keystore", ex); //$NON-NLS-1$
showErrorDialog(Messages.getString("error.KeyStore")); //$NON-NLS-1$
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java
index f0b4f8f0..7578d1c3 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java
@@ -33,6 +33,6 @@ public class KeystoreDoesntExistException extends ResumableException {
* @param resumeIndex The resume Index
*/
public KeystoreDoesntExistException(final File keystore, int resumeIndex) {
- super(String.format(Messages.getString("error.FileNotExist"), keystore.getPath()), resumeIndex); //$NON-NLS-1$
+ super(String.format(Messages.getString("error.KeyStoreFileNotExist"), keystore.getPath()), resumeIndex); //$NON-NLS-1$
}
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java
index eaeba4c8..2e5c0d75 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java
@@ -16,6 +16,8 @@
package at.asit.pdfover.gui.workflow.states;
// Imports
+import java.io.File;
+
import org.eclipse.swt.SWT;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,6 +68,21 @@ public class KSState extends State {
try {
String file = config.getKeyStoreFile();
+ File f = new File(file);
+ if (!f.isFile()) {
+ log.error("Keystore not found"); //$NON-NLS-1$
+ ErrorDialog dialog = new ErrorDialog(
+ getStateMachine().getGUIProvider().getMainShell(),
+ String.format(Messages.getString("error.KeyStoreFileNotExist"), f.getName()), //$NON-NLS-1$
+ BUTTONS.RETRY_CANCEL);
+ if (dialog.open() != SWT.RETRY) {
+ //getStateMachine().exit();
+ this.setNextState(new BKUSelectionState(getStateMachine()));
+ return;
+ }
+ this.run();
+ return;
+ }
String alias = config.getKeyStoreAlias();
String storePass = config.getKeyStoreStorePass();
if (storePass.isEmpty()) {