Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211385

(zipfs) ZipDirectoryStream yields a stream of absolute paths when directory is relative

XMLWordPrintable

    • b14
    • Verified

        Files.newDirectortyStream specifies "The Path objects are obtained as if by resolving the name of the directory entry against dir". If the path to the directory is a relative path then the Path objects created for the entries in the directory should also be relative. The zip file system provider doesn't implement this correctly, e.g.

        Path dir = zipfs.getPath("META-INF");
        Files.list(dir).forEach(System.out::println)

        will print absolute paths (/META-INF/MANIFEST.MF for example) when it should print relative paths.

              sherman Xueming Shen
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: