From d82c9837a3f7c250ed116487ab874b6825562e1f Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 30 Oct 2014 17:25:31 +0100 Subject: added Option to keep invalid signatures --- .../egiz/pdfas/common/exceptions/ErrorConstants.java | 1 + .../at/gv/egiz/pdfas/common/utils/SettingsUtils.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java (limited to 'pdf-as-common/src/main/java/at/gv/egiz/pdfas') 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; + } +} -- cgit v1.2.3