Skip to content

Commit

Permalink
FD-7423. Fix upload zip with backslashes (IQSS#174)
Browse files Browse the repository at this point in the history
* FD-7423. Fix upload zip with backslashes

* Fix upload zip with backslashes
  • Loading branch information
PaulBoon authored Aug 22, 2023
1 parent 5834c05 commit bdee5fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ public static CreateDataFileResult createDataFiles(DatasetVersion version, Input
ZipEntry entry = entries.nextElement();
logger.fine("inside first zip pass; this entry: "+entry.getName());
if (!entry.isDirectory()) {
String shortName = entry.getName().replaceFirst("^.*[\\/]", "");
String shortName = entry.getName().replaceFirst("^.*[\\\\/]", "");
// ... and, finally, check if it's a "fake" file - a zip archive entry
// created for a MacOS X filesystem element: (these
// start with "._")
Expand Down Expand Up @@ -1055,7 +1055,7 @@ public static CreateDataFileResult createDataFiles(DatasetVersion version, Input

if (fileEntryName != null && !fileEntryName.equals("")) {

String shortName = fileEntryName.replaceFirst("^.*[\\/]", "");
String shortName = fileEntryName.replaceFirst("^.*[\\\\/]", "");

// Check if it's a "fake" file - a zip archive entry
// created for a MacOS X filesystem element: (these
Expand Down

0 comments on commit bdee5fc

Please sign in to comment.