From cec0065b747d30c6a0a17d18f2c7c8962a9102ed Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 17 Dec 2013 11:38:33 +0100 Subject: Pdf AS validation --- .../exceptions/PdfAsValidationException.java | 23 ++++++++++++++++++++++ .../at/gv/egiz/pdfas/common/settings/Settings.java | 6 +++++- .../resources/resources/messages/common.properties | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsValidationException.java (limited to 'pdf-as-common/src') diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsValidationException.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsValidationException.java new file mode 100644 index 00000000..61bfffda --- /dev/null +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsValidationException.java @@ -0,0 +1,23 @@ +package at.gv.egiz.pdfas.common.exceptions; + +import at.gv.egiz.pdfas.common.messages.MessageResolver; + +public class PdfAsValidationException extends PdfAsException { + + /** + * + */ + private static final long serialVersionUID = -2428540014894153122L; + + private String parameter; + + public PdfAsValidationException(String msgId, String parameter) { + super(msgId); + this.parameter = parameter; + } + + @Override + protected String localizeMessage(String msgId) { + return String.format(MessageResolver.resolveMessage(msgId), parameter); + } +} diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java index f3e17ab8..255c8ba8 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/Settings.java @@ -42,7 +42,11 @@ public class Settings implements ISettings, IProfileConstants{ while(includeIterator.hasNext()) { String includeFile = configDir + File.separator + includeIterator.next(); logger.debug("Loading included cfg file: " + includeFile); - properties.load(new FileInputStream(includeFile)); + try { + properties.load(new FileInputStream(includeFile)); + } catch(Throwable e) { + logger.error("Failed to load cfg file " + includeFile, e); + } } } diff --git a/pdf-as-common/src/main/resources/resources/messages/common.properties b/pdf-as-common/src/main/resources/resources/messages/common.properties index dadef742..ef3b4949 100644 --- a/pdf-as-common/src/main/resources/resources/messages/common.properties +++ b/pdf-as-common/src/main/resources/resources/messages/common.properties @@ -33,6 +33,7 @@ error.pdf.sig.05=Failed to continue signature process error.pdf.sig.06=Failed to finish signature process error.pdf.sig.07=Failed to determine Signature Profile error.pdf.sig.08=Signature created by the BKU is not valid +error.pdf.sig.09=Signature profile %s not available #Signature verification errors -- cgit v1.2.3