summaryrefslogtreecommitdiff
path: root/pdf-over-signator/src/main
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-10-25 17:13:56 +0200
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-10-25 17:13:56 +0200
commitf2628d686bc18f84fc740741634b03908aa28d4f (patch)
tree87133913aed5bb6ad0e257800a36e414992a49ed /pdf-over-signator/src/main
parentb2aa9ee20c719530cebebd6778ccedde292e6df2 (diff)
downloadpdf-over-f2628d686bc18f84fc740741634b03908aa28d4f.tar.gz
pdf-over-f2628d686bc18f84fc740741634b03908aa28d4f.tar.bz2
pdf-over-f2628d686bc18f84fc740741634b03908aa28d4f.zip
Check emblem hash for placeholder cache
Diffstat (limited to 'pdf-over-signator/src/main')
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java
index dc54d84a..fe08abb6 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java
@@ -93,7 +93,7 @@ public class CachedFileNameEmblem implements Emblem {
return cachedEmblemFileName; //$NON-NLS-1$
}
}
- log.debug("Emblem cache miss");
+ log.debug("Emblem cache miss"); //$NON-NLS-1$
} catch (Exception e) {
log.warn("Can't load emblem cache", e); //$NON-NLS-1$
}
@@ -147,4 +147,19 @@ public class CachedFileNameEmblem implements Emblem {
public String getOriginalFileName() {
return this.fileName;
}
+
+ /**
+ * Return the original filename
+ * @return the original filename
+ */
+ public String getOriginalFileHash() {
+ if (this.fileName == null || !(new File(this.fileName).exists()))
+ return ""; //$NON-NLS-1$
+ try {
+ return getFileHash(this.fileName);
+ } catch (IOException e) {
+ log.debug("Error getting file hash", e);
+ return ""; //$NON-NLS-1$
+ }
+ }
}