summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-02 14:20:38 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-02 14:20:38 +0200
commit9db67a0963f01d5c893d76c8e746272a53703d91 (patch)
treea59c979806e3ecf208b6b233e85d14c9cfa32392
parent62a3115ce4d55a7a3b3fbf202bac0fff85dc412b (diff)
downloadpdf-over-9db67a0963f01d5c893d76c8e746272a53703d91.tar.gz
pdf-over-9db67a0963f01d5c893d76c8e746272a53703d91.tar.bz2
pdf-over-9db67a0963f01d5c893d76c8e746272a53703d91.zip
YAGNI: newParameter factory
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java5
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java3
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java5
-rw-r--r--pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java4
4 files changed, 8 insertions, 9 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
index c5ad6f5a..b00dc00a 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java
@@ -68,6 +68,7 @@ import at.asit.pdfover.gui.workflow.config.ConfigurationDataInMemory;
import at.asit.pdfover.gui.workflow.states.State;
import at.asit.pdfover.signator.CachedFileNameEmblem;
import at.asit.pdfover.signator.SignatureParameter;
+import at.asit.pdfover.signer.pdfas.PdfAs4SignatureParameter;
import at.asit.pdfover.signer.pdfas.PdfAs4Signer;
/**
@@ -441,7 +442,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase {
ImageData logo = null;
try {
- SignatureParameter param = PdfAs4Signer.newParameter();
+ SignatureParameter param = new PdfAs4SignatureParameter();
if(this.configurationContainer.signatureNote != null && !this.configurationContainer.signatureNote.isEmpty()) {
param.setProperty("SIG_NOTE", this.configurationContainer.signatureNote);
}
@@ -555,7 +556,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase {
void setSignatureProfileSetting(){
try {
- SignatureParameter param = PdfAs4Signer.newParameter();
+ SignatureParameter param = new PdfAs4SignatureParameter();
param.setSignatureProfile(this.configurationContainer.getSignatureProfile().name());
} catch (Exception e){
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java
index 142e3965..1b1a978c 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java
@@ -39,6 +39,7 @@ import at.asit.pdfover.signator.CachedFileNameEmblem;
import at.asit.pdfover.signator.Emblem;
import at.asit.pdfover.signator.SignatureParameter;
import at.asit.pdfover.signator.SignaturePosition;
+import at.asit.pdfover.signer.pdfas.PdfAs4SignatureParameter;
import at.asit.pdfover.signer.pdfas.PdfAs4Signer;
/**
@@ -108,7 +109,7 @@ public class PositioningState extends State {
}
// Update possibly changed values
ConfigurationManager config = stateMachine.configProvider;
- SignatureParameter param = PdfAs4Signer.newParameter();
+ SignatureParameter param = new PdfAs4SignatureParameter();
Emblem emblem = new CachedFileNameEmblem(config.getDefaultEmblem());
param.setEmblem(emblem);
if(config.getSignatureNote() != null && !config.getSignatureNote().isEmpty()) {
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java
index 7964fe40..57a91da5 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java
@@ -35,6 +35,7 @@ import at.asit.pdfover.gui.workflow.config.ConfigurationManager;
import at.asit.pdfover.signator.CachedFileNameEmblem;
import at.asit.pdfover.signator.PDFFileDocumentSource;
import at.asit.pdfover.signator.SignatureParameter;
+import at.asit.pdfover.signer.pdfas.PdfAs4SignatureParameter;
import at.asit.pdfover.signer.pdfas.PdfAs4Signer;
/**
@@ -124,7 +125,7 @@ public class PrepareSigningState extends State {
}
if (this.state.signatureParameter == null) {
- this.state.signatureParameter = PdfAs4Signer.newParameter();
+ this.state.signatureParameter = new PdfAs4SignatureParameter();
}
this.state.signatureParameter.setInputDocument(new PDFFileDocumentSource(status.document));
@@ -193,7 +194,7 @@ public class PrepareSigningState extends State {
Status status = getStateMachine().status;
if (this.signatureParameter == null) {
- this.signatureParameter = PdfAs4Signer.newParameter();
+ this.signatureParameter = new PdfAs4SignatureParameter();
}
if (this.signingState == null && this.threadException == null) {
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
index bc5d4263..5d3e2b64 100644
--- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
+++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
@@ -150,8 +150,4 @@ public class PdfAs4Signer {
throw new SignatureException(e);
}
}
-
- public static SignatureParameter newParameter() {
- return new PdfAs4SignatureParameter();
- }
}