From 01335ef96a21169de7b61b95080125280ecdd43c Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Fri, 5 Jul 2019 22:53:16 +0200 Subject: [PATCH] fixed Issue #65 --- .../java/org/imixs/archive/core/SnapshotService.java | 11 +++++++++-- pom.xml | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/imixs-archive-api/src/main/java/org/imixs/archive/core/SnapshotService.java b/imixs-archive-api/src/main/java/org/imixs/archive/core/SnapshotService.java index cb49deb9..d50c1fad 100644 --- a/imixs-archive-api/src/main/java/org/imixs/archive/core/SnapshotService.java +++ b/imixs-archive-api/src/main/java/org/imixs/archive/core/SnapshotService.java @@ -117,6 +117,8 @@ @RunAs("org.imixs.ACCESSLEVEL.MANAGERACCESS") public class SnapshotService { + public static final String REGEX_URL_PATTERN = "^(http|https|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"; + public static final String SNAPSHOTID = "$snapshotid"; public static final String TYPE_PRAFIX = "snapshot-"; public static final String NOSNAPSHOT = "$nosnapshot"; // ignore snapshots @@ -482,11 +484,16 @@ private void copyFilesFromItemCollection(ItemCollection source, ItemCollection t FileData oldFileData = source.getFileData(fileName); if (oldFileData != null) { logger.fine("copy file content '" + fileName + "' from: " + source.getUniqueID()); - target.addFileData(new FileData(fileName, oldFileData.getContent(), oldFileData.getContentType(), oldFileData.getAttributes())); } else { - logger.warning("Missing file content!"); + // if the file data is a link/url we did not find content + if (fileName.matches(REGEX_URL_PATTERN)) { + // In case of an URL we do not need to copy the file content + logger.fine("URL - no file content for "+fileName); + } else { + logger.warning("Missing file content!"); + } } } else { logger.warning("Missing file content!"); diff --git a/pom.xml b/pom.xml index 25f27e7c..8bc09117 100644 --- a/pom.xml +++ b/pom.xml @@ -78,8 +78,8 @@ UTF-8 - 5.0.0-SNAPSHOT - 1.0.9-SNAPSHOT + 5.0.0 + 1.0.9 1.2.1 2.0.12 2.2