Commit 1add0410 authored by Costin Grigoras's avatar Costin Grigoras
Browse files

Go up one level if the archive member is in a subfolder

parent 0ac80d6f
...@@ -1235,12 +1235,17 @@ public class LFNUtils { ...@@ -1235,12 +1235,17 @@ public class LFNUtils {
UUID guid = null; UUID guid = null;
String zipMember = null;
final Set<PFN> listing = file.whereis(); final Set<PFN> listing = file.whereis();
if (listing != null) if (listing != null)
for (final PFN p : listing) for (final PFN p : listing)
if (p.pfn != null && p.pfn.startsWith("guid:/")) if (p.pfn != null && p.pfn.startsWith("guid:/"))
try { try {
guid = UUID.fromString(p.pfn.substring(p.pfn.lastIndexOf('/') + 1, p.pfn.indexOf('?'))); guid = UUID.fromString(p.pfn.substring(p.pfn.lastIndexOf('/', p.pfn.indexOf('?')) + 1, p.pfn.indexOf('?')));
zipMember = p.pfn.substring(p.pfn.indexOf('?') + 1);
break; break;
} catch (final Exception e) { } catch (final Exception e) {
logger.log(Level.WARNING, "Failed to parse guid ", e); logger.log(Level.WARNING, "Failed to parse guid ", e);
...@@ -1252,6 +1257,10 @@ public class LFNUtils { ...@@ -1252,6 +1257,10 @@ public class LFNUtils {
try { try {
LFN parentDir = file.getParentDir(); LFN parentDir = file.getParentDir();
if (zipMember != null && zipMember.indexOf('/') > 0 && parentDir != null)
parentDir = parentDir.getParentDir();
if (parentDir != null && parentDir.list() != null) if (parentDir != null && parentDir.list() != null)
for (final LFN otherFile : parentDir.list()) for (final LFN otherFile : parentDir.list())
if (otherFile.isFile() && otherFile.guid != null && otherFile.guid.equals(guid)) if (otherFile.isFile() && otherFile.guid != null && otherFile.guid.equals(guid))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment