aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-common/src')
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java1
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java19
2 files changed, 20 insertions, 0 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java
index 8ab02028..cf57f742 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java
@@ -3,6 +3,7 @@ package at.gv.egiz.pdfas.common.exceptions;
public interface ErrorConstants {
public static final String STATUS_INFO_SIGDEVICE = "SigDevice";
public static final String STATUS_INFO_SIGDEVICEVERSION = "SigDeviceVersion";
+ public static final String STATUS_INFO_INVALIDSIG = "InvalidSignature";
// Code below 10000 are reserved for SL Error Codes
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java
new file mode 100644
index 00000000..7628406d
--- /dev/null
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java
@@ -0,0 +1,19 @@
+package at.gv.egiz.pdfas.common.utils;
+
+import at.gv.egiz.pdfas.common.settings.ISettings;
+
+public class SettingsUtils {
+ public static boolean getBooleanValue(ISettings setting, String key, boolean defaultValue) {
+ String theValue = setting.getValue(key);
+ if(theValue != null) {
+ if(theValue.equals("true")) {
+ return true;
+ } else if(theValue.equals("false")) {
+ return false;
+ } else {
+ return defaultValue;
+ }
+ }
+ return defaultValue;
+ }
+}