diff options
author | pdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-12-06 17:03:11 +0000 |
---|---|---|
committer | pdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2010-12-06 17:03:11 +0000 |
commit | bcb6fe101500823a146685c07e448e4d51ae93ed (patch) | |
tree | b0718b554c285c7ee30a20fee49bf90cb8779d8b /src/main/java/at/gv/egiz | |
parent | 73c30d3a15a33d02f7ea675e267b39310913ba4d (diff) | |
download | pdf-as-3-bcb6fe101500823a146685c07e448e4d51ae93ed.tar.gz pdf-as-3-bcb6fe101500823a146685c07e448e4d51ae93ed.tar.bz2 pdf-as-3-bcb6fe101500823a146685c07e448e4d51ae93ed.zip |
Removed dependency for VerifyServlet
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@681 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/commandline/Main.java | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/commandline/Main.java b/src/main/java/at/gv/egiz/pdfas/commandline/Main.java index 88fd502..2dc551f 100644 --- a/src/main/java/at/gv/egiz/pdfas/commandline/Main.java +++ b/src/main/java/at/gv/egiz/pdfas/commandline/Main.java @@ -67,7 +67,6 @@ import at.knowcenter.wag.egov.egiz.pdf.TablePos; import at.knowcenter.wag.egov.egiz.sig.ConnectorFactory;
import at.knowcenter.wag.egov.egiz.sig.ConnectorInformation;
import at.knowcenter.wag.egov.egiz.sig.SignatureTypes;
-import at.knowcenter.wag.egov.egiz.web.servlets.VerifyServlet;
/**
* The main program entry point of the commandline tool.
@@ -657,7 +656,7 @@ public abstract class Main {
fileSize = file.length();
}
- String extension = VerifyServlet.extractExtension(input);
+ String extension = extractExtension(input);
if (extension != null && extension.equals("txt"))
{
try
@@ -699,6 +698,34 @@ public abstract class Main }
}
+
+ /**
+ * Extracts the extension from a file name string.
+ *
+ * <p>
+ * The extension of a file name is whatever text follows the last '.'.
+ * </p>
+ *
+ * @param file_name
+ * The file name.
+ * @return Returns the extension. If the file name ends with the '.', then an
+ * empty string is returned. If the file name doesn't contain any '.'
+ * or file_name is null, null is returned.
+ */
+ public static String extractExtension(String file_name)
+ {
+ if (file_name == null)
+ {
+ return null;
+ }
+
+ int dot_index = file_name.lastIndexOf('.');
+ if (dot_index < 0)
+ {
+ return null;
+ }
+ return file_name.substring(dot_index + 1);
+ }
public static void processSign(DataSource dataSource, String connector, String signature_mode, String signature_type, String pos_string, boolean search_placeholder, String placeholderId, int placeholderMatchMode, DataSink dataSink) throws PdfAsException
{
|