Fix importing an archive containing colons (:) in the names on Windows
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / internal / tmf / ui / project / wizards / importtrace / GzipLeveledStructureProvider.java
index 47da8ea65718b09f71c5e841f935b358172e2ec4..4dbc7b480acefe469917a07b6c0fc751b2a7253c 100644 (file)
@@ -61,7 +61,8 @@ public class GzipLeveledStructureProvider implements ILeveledImportStructureProv
 
     @Override
     public String getFullPath(Object element) {
-        return ((GzipEntry) element).getName();
+        String name = ((GzipEntry) element).getName();
+        return ArchiveUtil.toValidNamesPath(name).toOSString();
     }
 
     @Override
@@ -69,7 +70,12 @@ public class GzipLeveledStructureProvider implements ILeveledImportStructureProv
         if (element != root && element != fEntry) {
             throw new IllegalArgumentException();
         }
-        return ((GzipEntry) element).getName();
+        String name = ((GzipEntry) element).getName();
+        if (element.equals(root)) {
+            return name;
+        }
+
+        return ArchiveUtil.toValidNamesPath(name).lastSegment();
     }
 
     /**
This page took 0.025129 seconds and 5 git commands to generate.