Skip to content

Commit

Permalink
fix bug sub folders appearing on top level
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeLtDave authored and Michael5601 committed Jun 18, 2024
1 parent ba42ff1 commit 7350ba7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
if (!dir.equals(zipRoot)) {
String dirName = zipRoot.relativize(dir).toString() + "/"; //$NON-NLS-1$
entryList.add(new ZipEntry(dirName));
return FileVisitResult.SKIP_SUBTREE; // Skip the subdirectories
}
return FileVisitResult.CONTINUE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public void testOpenDeepNestedTextFile() throws IOException, CoreException, URIS
ensureExists(nestedFile);
assertTextFileContent(nestedFile, "Hello World!");

String nestedPathShouldFail = "sub2";
IFolder nestedFileShouldFail = openedNestedZipFileParent.getFolder(nestedPathShouldFail);
ensureDoesNotExist(nestedFileShouldFail);

String deepNestedPath = "sub1/sub2/sub3/sub4/sub5/sub6/sub8/sub9/sub10/Text.txt";
IFile deepNestedFile = openedNestedZipFileParent.getFile(deepNestedPath);
ensureExists(deepNestedFile);
Expand Down

0 comments on commit 7350ba7

Please sign in to comment.