Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
Issue #65
  • Loading branch information
rsoika committed Jul 5, 2019
1 parent 05a7612 commit 01335ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!");
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.imixs.workflow.version>5.0.0-SNAPSHOT</org.imixs.workflow.version>
<org.imixs.melman.version>1.0.9-SNAPSHOT</org.imixs.melman.version>
<org.imixs.workflow.version>5.0.0</org.imixs.workflow.version>
<org.imixs.melman.version>1.0.9</org.imixs.melman.version>
<org.imixs.archive.version>1.2.1</org.imixs.archive.version>
<apache.pdfbox.version>2.0.12</apache.pdfbox.version>
<microprofile.version>2.2</microprofile.version>
Expand Down

0 comments on commit 01335ef

Please sign in to comment.