aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/web
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2008-01-18 15:13:13 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2008-01-18 15:13:13 +0000
commit877758d9ec4deb53aad8a6c1d8669cc7186b1a48 (patch)
tree97cbeef0ef915511f94782d2501b283b8a077e2e /src/main/java/at/knowcenter/wag/egov/egiz/web
parent9770635e1bdcc3338468e9687545d5326a394630 (diff)
downloadpdf-as-3-877758d9ec4deb53aad8a6c1d8669cc7186b1a48.tar.gz
pdf-as-3-877758d9ec4deb53aad8a6c1d8669cc7186b1a48.tar.bz2
pdf-as-3-877758d9ec4deb53aad8a6c1d8669cc7186b1a48.zip
update dealing with incremental updates
(NoSignatureHolder introduced that indicates incremental updates. NoSignatureHolders are transported as SignatureHolder withing analysis but are finally removed to maintain compatibility. This allowes to show which signatures are followed by incremental updates containing no signature. If the last signature is followed by an incremental update, an exception is thrown to indicate an illegal modification. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@248 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/web')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java
index 7b935de..eb07828 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java
@@ -20,6 +20,7 @@ package at.knowcenter.wag.egov.egiz.web.servlets;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -50,6 +51,8 @@ import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException;
import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
import at.knowcenter.wag.egov.egiz.exceptions.SettingNotFoundException;
+import at.knowcenter.wag.egov.egiz.pdf.NoSignatureHolder;
+import at.knowcenter.wag.egov.egiz.pdf.SignatureHolder;
import at.knowcenter.wag.egov.egiz.sig.ConnectorFactory;
import at.knowcenter.wag.egov.egiz.sig.SignatureResponse;
import at.knowcenter.wag.egov.egiz.web.FormFields;
@@ -324,12 +327,22 @@ public class VerifyServlet extends HttpServlet
ExtractionStage es = new ExtractionStage();
List signature_holders = es.extractSignatureHolders(dataSource, parameters);
- if (signature_holders.size() == 0)
+ // filter out NoSignatureHolders that are possibly present due to the direct call method extractSignatureHolders()
+ List filtered_signature_holders = new ArrayList();
+ Iterator it = signature_holders.iterator();
+ while(it.hasNext()) {
+ SignatureHolder current = (SignatureHolder) it.next();
+ if(!(current instanceof NoSignatureHolder)) {
+ filtered_signature_holders.add(current);
+ }
+ }
+
+ if (filtered_signature_holders.size() == 0)
{
throw new PDFDocumentException(206, "PDF document not signed."); //$NON-NLS-1$
}
- return signature_holders;
+ return filtered_signature_holders;
}
// TODO obsolete method - remove