Skip to content

Commit

Permalink
Download of study via the UI leads to java.util.zip.ZipException: dup…
Browse files Browse the repository at this point in the history
…licate entry: DICOM/ fix #3101
  • Loading branch information
gunterze committed Mar 24, 2021
1 parent 6cffbff commit 5c91237
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1330,12 +1330,15 @@ private Object writeZIP(RetrieveContext ctx) {
};
}

private void addDirEntries(ZipOutputStream zip, String name, Set<String> added) throws IOException {
private static void addDirEntries(ZipOutputStream zip, String name, Set<String> added) throws IOException {
int endIndex = 0;
int i;
while ((i = name.indexOf('/', endIndex)) >= 0) {
zip.putNextEntry(new ZipEntry(name.substring(0, endIndex = (i + 1))));
zip.closeEntry();
String entry = name.substring(0, endIndex = (i + 1));
if (added.add(entry)) {
zip.putNextEntry(new ZipEntry(entry));
zip.closeEntry();
}
}
}

Expand Down

0 comments on commit 5c91237

Please sign in to comment.