Skip to content
Snippets Groups Projects
Commit c789b692 authored by nfcalabria's avatar nfcalabria
Browse files

Fix

parent b4e11d28
No related branches found
No related tags found
No related merge requests found
...@@ -239,15 +239,16 @@ public class ArchiveService { ...@@ -239,15 +239,16 @@ public class ArchiveService {
List<String> vosPaths = entryDescriptors.stream().map(ed -> ed.getVosPath()) List<String> vosPaths = entryDescriptors.stream().map(ed -> ed.getVosPath())
.collect(Collectors.toList()); .collect(Collectors.toList());
/*
if (vosPaths.size() == 1) { if (vosPaths.size() == 1) {
String vosPath = vosPaths.get(0); String vosPath = vosPaths.get(0);
return vosPath.substring(0, vosPath.lastIndexOf("/")); return vosPath.substring(0, vosPath.lastIndexOf("/"));
} }*/
String commonParent = null; String commonParent = null;
for (String vosPath : vosPaths) { for (String vosPath : vosPaths) {
if (commonParent == null) { if (commonParent == null) {
commonParent = vosPath; commonParent = vosPath.substring(0, vosPath.lastIndexOf("/"));
} else { } else {
StringBuilder newCommonParent = new StringBuilder(); StringBuilder newCommonParent = new StringBuilder();
boolean same = true; boolean same = true;
...@@ -262,7 +263,7 @@ public class ArchiveService { ...@@ -262,7 +263,7 @@ public class ArchiveService {
commonParent = newCommonParent.toString(); commonParent = newCommonParent.toString();
} }
} }
return commonParent; return commonParent.substring(0, commonParent.lastIndexOf("/"));
} }
private abstract class ArchiveHandler<O extends OutputStream, E> implements AutoCloseable { private abstract class ArchiveHandler<O extends OutputStream, E> implements AutoCloseable {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment