From e2ab585fc4cfc165dc02ea9142f33dd308979e49 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Mon, 3 Oct 2022 17:36:36 +0200 Subject: start untangling BKU handler from GUI logic --- pdf-over-commons/pom.xml | 4 ++++ .../src/main/java/at/asit/pdfover/commons/Constants.java | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'pdf-over-commons') diff --git a/pdf-over-commons/pom.xml b/pdf-over-commons/pom.xml index 58ea1e9f..712a6670 100644 --- a/pdf-over-commons/pom.xml +++ b/pdf-over-commons/pom.xml @@ -26,6 +26,10 @@ com.drewnoakes metadata-extractor + + com.google.code.findbugs + jsr305 + diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java index 3c9aced8..9c6d2111 100644 --- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java +++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java @@ -17,9 +17,12 @@ package at.asit.pdfover.commons; import java.io.File; import java.io.FileInputStream; +import java.net.URI; import java.util.Locale; import java.util.Properties; +import javax.annotation.Nonnull; + import org.eclipse.swt.graphics.Color; import org.eclipse.swt.widgets.Display; import org.slf4j.Logger; @@ -107,7 +110,7 @@ public class Constants { public static final String LOCAL_BKU_URL = "http://127.0.0.1:3495/http-security-layer-request"; /** Default Mobile BKU URL */ - public static final String MOBILE_BKU_URL = "https://www.a-trust.at/mobile/https-security-layer-request/default.aspx"; + public static final URI MOBILE_BKU_URL = URI.create("https://www.a-trust.at/mobile/https-security-layer-request/default.aspx"); /** How far to displace the signature with the arrow keys */ public static final int SIGNATURE_KEYBOARD_POSITIONING_OFFSET = 15; @@ -370,4 +373,10 @@ public class Constants { public static final String LABEL_BTN_IDF = "Button_Identification"; + /** + * for static analysis; mark a given value as definitely, contractually not null + * (try to avoid its use in performance-critical code, grr java) + */ + public static @Nonnull T ISNOTNULL(T value) { assert(value != null); return value; } + } -- cgit v1.2.3