-
Enhancement
-
Resolution: Fixed
-
P3
-
9-repo-jigsaw
The Files.newDirectorStream and Files.list methods are specified to return an iterator of Path objects where "The Path objects are obtained as if by resolving the name of the directory entry against dir".
In jigsaw/m2, then using invoking these methods with a relative path returns an iterator of Path objects that are absolute paths. For example, this fails:
Path base = fs.getPath("java.base");
try (DirectoryStream<Path> stream = Files.newDirectoryStream(base)) {
for (Path entry: stream) {
assertTrue( entry.getParent().equals(base) );
}
}
A related issue is that the String representation of entries that are directories have trailing slashes, a bug that may have transferred from the zipfs provider.
In jigsaw/m2, then using invoking these methods with a relative path returns an iterator of Path objects that are absolute paths. For example, this fails:
Path base = fs.getPath("java.base");
try (DirectoryStream<Path> stream = Files.newDirectoryStream(base)) {
for (Path entry: stream) {
assertTrue( entry.getParent().equals(base) );
}
}
A related issue is that the String representation of entries that are directories have trailing slashes, a bug that may have transferred from the zipfs provider.