aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-11-29 14:26:36 +0000
committerpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-11-29 14:26:36 +0000
commit99da8df4fbd6420632adec989e3fb13a641be591 (patch)
tree5b22ff23e79f99d8c27ba09323dfa202561fe2e8 /src/main
parentfe1f6bed978d1fad7911d7c4569508bc240b6df0 (diff)
downloadpdf-as-3-99da8df4fbd6420632adec989e3fb13a641be591.tar.gz
pdf-as-3-99da8df4fbd6420632adec989e3fb13a641be591.tar.bz2
pdf-as-3-99da8df4fbd6420632adec989e3fb13a641be591.zip
fixed some wprinz stuff
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@635 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/commandline/Main.java37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/commandline/Main.java b/src/main/java/at/knowcenter/wag/egov/egiz/commandline/Main.java
index a746612..919201f 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/commandline/Main.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/commandline/Main.java
@@ -26,6 +26,7 @@ import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -34,6 +35,7 @@ import at.gv.egiz.pdfas.commandline.CommandlineConnectorChooser;
import at.gv.egiz.pdfas.exceptions.ErrorCode;
import at.gv.egiz.pdfas.exceptions.ErrorCodeHelper;
import at.gv.egiz.pdfas.exceptions.external.ExternalErrorException;
+import at.gv.egiz.pdfas.framework.DataSourceHolder;
import at.gv.egiz.pdfas.framework.config.SettingsHelper;
import at.gv.egiz.pdfas.framework.input.DataSource;
import at.gv.egiz.pdfas.framework.input.ExtractionStage;
@@ -569,7 +571,7 @@ public abstract class Main
throw new PDFDocumentException(ErrorCode.DOCUMENT_CANNOT_BE_READ, e);
}
- List results = processVerify(dataSource, connector, verify_which);
+ List results = processVerify(new DataSourceHolder(dataSource), connector, verify_which);
messageOutput.println("Verification results:");
formatVerifyResults(results, messageOutput);
@@ -630,12 +632,12 @@ public abstract class Main
String connectorId = CommandlineConnectorChooser.chooseCommandlineConnectorForSign(connector);
- PdfAS.signCommandline(pdfDataSource, dataSink, signatorId, connectorId, signature_type, null, pos, null);
+ PdfAS.signCommandline(pdfDataSource, dataSink, signatorId, connectorId, signature_type, null, pos, null, null);
// PdfAS.sign(algorithm, pdfDataSource, dataSink, signature_type, connector, pos);
}
- public static List processVerify(DataSource dataSource, String connector, int verify_which) throws PresentableException
+ public static List processVerify(DataSourceHolder dataSource, String connector, int verify_which) throws PresentableException
{
VerificationFilterParameters parameters = SettingsHelper.readVerificationFilterParametersFromSettings();
ExtractionStage es = new ExtractionStage();
@@ -883,7 +885,7 @@ public abstract class Main
writer.print(" " + PARAMETER_SIGNATURE_TYPE + " <");
SignatureTypes sig_types = SignatureTypes.getInstance();
SettingsReader settings = SettingsReader.getInstance();
- List types_array = sig_types.getSignatureTypes();
+ Set types_array = sig_types.getSignatureTypes();
Iterator it = types_array.iterator();
while (it.hasNext())
{
@@ -982,18 +984,21 @@ public abstract class Main
*/
protected static boolean checkSignatureType(String signature_type) throws SignatureTypesException
{
- SignatureTypes sig_types = SignatureTypes.getInstance();
- List types_array = sig_types.getSignatureTypes();
- Iterator it = types_array.iterator();
- while (it.hasNext())
- {
- String type = (String) it.next();
- if (type.equals(signature_type))
- {
- return true;
- }
- }
- return false;
+ return SignatureTypes.getInstance().getSignatureTypes().contains(signature_type);
+
+ // exthex: uuuaaaahhhhh WHY??? wprinz again?, dont do that. Use List.contains(o), please
+ // take a java course and read: http://www.amazon.de/Java-f%C3%BCr-Dummies-Barry-Burd/dp/382662999X
+// List types_array = sig_types.getSignatureTypes();
+// Iterator it = types_array.iterator();
+// while (it.hasNext())
+// {
+// String type = (String) it.next();
+// if (type.equals(signature_type))
+// {
+// return true;
+// }
+// }
+// return false;
}
/**