RFR: 8295753: (fs) UnixPath::toRealPath does not return correct case when links not followed

Alan Bateman alanb at openjdk.org
Tue Oct 25 06:17:37 UTC 2022


On Mon, 24 Oct 2022 22:58:10 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> On macOS, ensure that the components of the `Path` returned by `UnixPath::toRealPath` have the case retained by the file system as opposed to that of the representation present in the `UnixPath` instance.

src/java.base/unix/classes/sun/nio/fs/UnixPath.java line 893:

> 891:             // to the path constructed thus far, and extract the entry whose
> 892:             // name is equal ignoring case to the name of the current element
> 893:             try (Stream<Path> entries = Files.list(path)) {

One initial comment on this is that you can't use Files.list in the provider implementation because the default provider can be configured to be something else. Also the security manager is still a supported execution mode so we'll need to work through the issues too.

-------------

PR: https://git.openjdk.org/jdk/pull/10843


More information about the nio-dev mailing list