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

Alan Bateman alanb at openjdk.org
Tue Oct 25 15:54:33 UTC 2022


On Tue, 25 Oct 2022 15:39:20 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> 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.
>
>> 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.
> 
> Yes, I knew that, but there is no equivalent in the provider. I guess `java.io.File::list` would work.

I think you'll have to change this to use UnixDirectoryStream here, it shouldn't be too hard. We'll also need to study the case check as I suspect that will need macOS specific code.

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

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


More information about the nio-dev mailing list