aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmina Ahmetovic <emina.ahmetovic@egiz.gv.at>2020-09-24 09:46:48 +0200
committerEmina Ahmetovic <emina.ahmetovic@egiz.gv.at>2020-09-24 09:46:48 +0200
commit7f66428916800f37fcc3ea67310d2ef73eb2fa38 (patch)
treefa85a78c66e86ee39ca3f57397bde06d1976c8e4
parenta07da1a7cf59e01e4125c82fafe3a2ab837e6a53 (diff)
downloadpdf-as-4-7f66428916800f37fcc3ea67310d2ef73eb2fa38.tar.gz
pdf-as-4-7f66428916800f37fcc3ea67310d2ef73eb2fa38.tar.bz2
pdf-as-4-7f66428916800f37fcc3ea67310d2ef73eb2fa38.zip
update libraries, use StringUtils
-rw-r--r--pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java1
-rw-r--r--pdf-as-lib/build.gradle2
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java11
-rw-r--r--pdf-as-lib/src/main/resources/config/config.zipbin1277230 -> 1276558 bytes
-rw-r--r--pdf-as-pdfbox-2/build.gradle2
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/configuration/ProfileValidator.java31
-rw-r--r--pdf-as-web-client/build.gradle2
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java80
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java1
-rw-r--r--signature-standards/sigs-pades/build.gradle2
-rw-r--r--signature-standards/sigs-pkcs7detached/build.gradle2
11 files changed, 55 insertions, 79 deletions
diff --git a/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java
index 32f18867..c2d35c40 100644
--- a/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java
+++ b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java
@@ -33,7 +33,6 @@ import java.util.UUID;
import javax.activation.DataSource;
-import at.gv.egiz.pdfas.lib.api.*;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
diff --git a/pdf-as-lib/build.gradle b/pdf-as-lib/build.gradle
index 2e000ef9..35f82172 100644
--- a/pdf-as-lib/build.gradle
+++ b/pdf-as-lib/build.gradle
@@ -67,7 +67,7 @@ dependencies {
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.4.0-b180830.0438'
- compile 'org.apache.commons:commons-collections4:4.0'
+ compile 'org.apache.commons:commons-collections4:4.4'
compile group: 'ognl', name: 'ognl', version: '3.0.8'
compile files('libs/iaik_eccelerate_cms.jar')
compile files('libs/iaik_eccelerate.jar')
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java
index 5919ee5d..500b9e24 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java
@@ -32,6 +32,7 @@ import at.gv.egiz.pdfas.common.settings.ISettings;
import at.gv.egiz.pdfas.lib.api.IConfigurationConstants;
import at.gv.egiz.pdfas.lib.impl.configuration.PlaceholderWebConfiguration;
import at.gv.egiz.pdfas.lib.impl.status.OperationStatus;
+import org.apache.commons.lang3.StringUtils;
public class PlaceholderFilter implements IConfigurationConstants,
PlaceholderExtractorConstants {
@@ -45,18 +46,18 @@ public class PlaceholderFilter implements IConfigurationConstants,
if (status.getPlaceholderConfiguration().isGlobalPlaceholderEnabled()) {
PlaceholderExtractor extractor = status.getBackend().getPlaceholderExtractor();
- if(signatureLocation!=null) {
+ if(StringUtils.isNotEmpty(signatureLocation)) {
placeholderID = signatureLocation;
} else {
placeholderID = PlaceholderWebConfiguration.getValue(PLACEHOLDER_WEB_ID);
- if(placeholderID == null) {
+ if(StringUtils.isEmpty(placeholderID)) {
placeholderID = settings.getValue(PLACEHOLDER_ID);
}
}
String placeholderModeString = settings.getValue(PLACEHOLDER_MODE);
int placeholderMode = PLACEHOLDER_MATCH_MODE_MODERATE;
- if (placeholderModeString != null) {
+ if (StringUtils.isNotEmpty(placeholderModeString)) {
try {
placeholderMode = Integer.parseInt(placeholderModeString);
if (placeholderMode < PLACEHOLDER_MODE_MIN
@@ -78,11 +79,11 @@ public class PlaceholderFilter implements IConfigurationConstants,
int placeholderMode = PLACEHOLDER_MATCH_MODE_SORTED;
placeholderID = status.getPlaceholderConfiguration().getProfilePlaceholderID(status.getRequestedSignature().getSignatureProfileID());
- if(placeholderID != null) {
+ if(StringUtils.isNotEmpty(placeholderID)) {
placeholderMode = PLACEHOLDER_MATCH_MODE_MODERATE;
}
String placeholderModeString = settings.getValue(PLACEHOLDER_MODE);
- if (placeholderModeString != null) {
+ if (StringUtils.isNotEmpty(placeholderModeString)) {
try {
placeholderMode = Integer.parseInt(placeholderModeString);
if (placeholderMode < PLACEHOLDER_MODE_MIN
diff --git a/pdf-as-lib/src/main/resources/config/config.zip b/pdf-as-lib/src/main/resources/config/config.zip
index 666b61a6..ebfeee02 100644
--- a/pdf-as-lib/src/main/resources/config/config.zip
+++ b/pdf-as-lib/src/main/resources/config/config.zip
Binary files differ
diff --git a/pdf-as-pdfbox-2/build.gradle b/pdf-as-pdfbox-2/build.gradle
index 6f885190..5f05277b 100644
--- a/pdf-as-pdfbox-2/build.gradle
+++ b/pdf-as-pdfbox-2/build.gradle
@@ -40,7 +40,7 @@ dependencies {
compile group: 'ognl', name: 'ognl', version: '3.0.6'
testCompile group: 'junit', name: 'junit', version: '4.+'
compile group: 'com.github.jai-imageio', name: 'jai-imageio-jpeg2000', version: '1.3.0'
- compile group: 'com.github.jai-imageio', name: 'jai-imageio-core', version: '1.3.1'
+ compile group: 'com.github.jai-imageio', name: 'jai-imageio-core', version: '1.4.0'
compile group: 'com.levigo.jbig2', name: 'levigo-jbig2-imageio', version: '1.6.5'
compile group: 'javax.activation', name: 'activation', version: '1.1.1'
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/configuration/ProfileValidator.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/configuration/ProfileValidator.java
index dcbe7122..1c57605b 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/configuration/ProfileValidator.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/configuration/ProfileValidator.java
@@ -1,8 +1,21 @@
package at.gv.egiz.pdfas.lib.impl.pdfbox2.configuration;
+import at.gv.egiz.pdfas.common.exceptions.PdfAsSettingsValidationException;
+import at.gv.egiz.pdfas.common.settings.ISettings;
+import at.gv.egiz.pdfas.common.settings.SignatureProfileSettings;
+import at.gv.egiz.pdfas.lib.api.ByteArrayDataSource;
+import at.gv.egiz.pdfas.lib.configuration.ConfigurationValidator;
+import at.gv.egiz.pdfas.lib.impl.pdfbox2.PDFBOXObject;
+import at.gv.egiz.pdfas.lib.impl.status.ICertificateProvider;
+import at.gv.egiz.pdfas.lib.impl.status.OperationStatus;
import iaik.asn1.ObjectID;
import iaik.asn1.structures.Name;
import iaik.x509.X509Certificate;
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.common.PDRectangle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -12,24 +25,6 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
-import org.apache.pdfbox.pdmodel.PDDocument;
-import org.apache.pdfbox.pdmodel.PDPage;
-import org.apache.pdfbox.pdmodel.common.PDRectangle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import at.gv.egiz.pdfas.common.exceptions.PdfAsSettingsValidationException;
-import at.gv.egiz.pdfas.common.settings.ISettings;
-import at.gv.egiz.pdfas.common.settings.SignatureProfileSettings;
-import at.gv.egiz.pdfas.lib.api.ByteArrayDataSource;
-import at.gv.egiz.pdfas.lib.configuration.ConfigurationValidator;
-import at.gv.egiz.pdfas.lib.impl.pdfbox2.PDFBOXObject;
-import at.gv.egiz.pdfas.lib.impl.stamping.TableFactory;
-import at.gv.egiz.pdfas.lib.impl.stamping.pdfbox2.PDFBoxTable;
-import at.gv.egiz.pdfas.lib.impl.status.ICertificateProvider;
-import at.gv.egiz.pdfas.lib.impl.status.OperationStatus;
-import at.knowcenter.wag.egov.egiz.table.Table;
-
public class ProfileValidator implements ConfigurationValidator{
private static final String NAME = "PDFBOX_2_PROFILE_VALIDATOR";
diff --git a/pdf-as-web-client/build.gradle b/pdf-as-web-client/build.gradle
index b820ede0..961c4c48 100644
--- a/pdf-as-web-client/build.gradle
+++ b/pdf-as-web-client/build.gradle
@@ -13,7 +13,7 @@ repositories {
}
dependencies {
- compile 'org.apache.commons:commons-collections4:4.+'
+ compile 'org.apache.commons:commons-collections4:4.4'
compile project (':pdf-as-common')
testCompile group: 'junit', name: 'junit', version: '4.+'
}
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
index 8f8850ed..11ee4790 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
@@ -23,60 +23,13 @@
******************************************************************************/
package at.gv.egiz.pdfas.web.helper;
-import iaik.x509.X509Certificate;
-
-import java.awt.Image;
-import java.awt.image.RenderedImage;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.security.cert.CertificateException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.imageio.ImageIO;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.bind.JAXBElement;
-import javax.xml.ws.WebServiceException;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.entity.ContentType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-
import at.gv.egiz.pdfas.api.ws.PDFASSignParameters;
import at.gv.egiz.pdfas.api.ws.PDFASSignParameters.Connector;
import at.gv.egiz.pdfas.api.ws.PDFASSignResponse;
import at.gv.egiz.pdfas.api.ws.PDFASVerificationResponse;
import at.gv.egiz.pdfas.common.exceptions.PDFASError;
import at.gv.egiz.pdfas.common.utils.PDFUtils;
-import at.gv.egiz.pdfas.lib.api.ByteArrayDataSource;
-import at.gv.egiz.pdfas.lib.api.Configuration;
-import at.gv.egiz.pdfas.lib.api.IConfigurationConstants;
-import at.gv.egiz.pdfas.lib.api.PdfAs;
-import at.gv.egiz.pdfas.lib.api.PdfAsFactory;
-import at.gv.egiz.pdfas.lib.api.StatusRequest;
+import at.gv.egiz.pdfas.lib.api.*;
import at.gv.egiz.pdfas.lib.api.sign.IPlainSigner;
import at.gv.egiz.pdfas.lib.api.sign.SignParameter;
import at.gv.egiz.pdfas.lib.api.sign.SignResult;
@@ -92,7 +45,6 @@ import at.gv.egiz.pdfas.web.servlets.UIEntryPointServlet;
import at.gv.egiz.pdfas.web.sl20.JsonSecurityUtils;
import at.gv.egiz.pdfas.web.sl20.SL20HttpBindingUtils;
import at.gv.egiz.pdfas.web.stats.StatisticEvent;
-import at.gv.egiz.sl.schema.CreateCMSSignatureResponseType;
import at.gv.egiz.sl.schema.InfoboxAssocArrayPairType;
import at.gv.egiz.sl.schema.InfoboxReadRequestType;
import at.gv.egiz.sl.schema.InfoboxReadResponseType;
@@ -108,6 +60,36 @@ import at.gv.egiz.sl20.exceptions.SLCommandoParserException;
import at.gv.egiz.sl20.utils.SL20Constants;
import at.gv.egiz.sl20.utils.SL20JSONBuilderUtils;
import at.gv.egiz.sl20.utils.SL20JSONExtractorUtils;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import iaik.x509.X509Certificate;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.entity.ContentType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.imageio.ImageIO;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.xml.bind.JAXBElement;
+import javax.xml.ws.WebServiceException;
+import java.awt.*;
+import java.awt.image.RenderedImage;
+import java.io.*;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.security.cert.CertificateException;
+import java.util.*;
+import java.util.List;
public class PdfAsHelper {
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
index b50b7dbd..5415b233 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java
@@ -76,7 +76,6 @@ public class PdfAsParameterExtractor {
public static final String PARAM_QRCODE_CONTENT = "qrcontent";
-
public static String getConnector(HttpServletRequest request) {
String connector = (String)request.getAttribute(PARAM_CONNECTOR);
if(connector != null) {
diff --git a/signature-standards/sigs-pades/build.gradle b/signature-standards/sigs-pades/build.gradle
index c67edbca..62fb154f 100644
--- a/signature-standards/sigs-pades/build.gradle
+++ b/signature-standards/sigs-pades/build.gradle
@@ -23,7 +23,7 @@ releases.dependsOn sourcesJar
dependencies {
compile project (':pdf-as-lib')
compile project (':pdf-as-common')
- compile 'org.apache.commons:commons-collections4:4.0'
+ compile 'org.apache.commons:commons-collections4:4.4'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
diff --git a/signature-standards/sigs-pkcs7detached/build.gradle b/signature-standards/sigs-pkcs7detached/build.gradle
index 197c6c07..3da05ccc 100644
--- a/signature-standards/sigs-pkcs7detached/build.gradle
+++ b/signature-standards/sigs-pkcs7detached/build.gradle
@@ -23,7 +23,7 @@ releases.dependsOn sourcesJar
dependencies {
compile project (':pdf-as-lib')
compile project (':pdf-as-common')
- compile 'org.apache.commons:commons-collections4:4.0'
+ compile 'org.apache.commons:commons-collections4:4.4'
testCompile group: 'junit', name: 'junit', version: '4.+'
}