diff options
Diffstat (limited to 'pdf-over-signator/src')
-rw-r--r-- | pdf-over-signator/src/main/java/at/asit/pdfover/signator/CachedFileNameEmblem.java | 17 |
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$ + } + } } |