RFR: 8340329: (fs) Message of NotLinkException thrown by FIles.readSymbolicLink does not include file name (win)

Alan Bateman alanb at openjdk.org
Wed Sep 18 06:20:05 UTC 2024


On Tue, 17 Sep 2024 23:50:29 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Add the file name of the Path passed to `Files.readSymbolicLink` to the message of the `NotLinkException` thrown when the path is not a reparse point which represents a symbolic link.
>
> src/java.base/windows/classes/sun/nio/fs/WindowsLinkSupport.java line 308:
> 
>> 306:                 String filename = null;
>> 307:                 try {
>> 308:                     filename = GetFinalPathNameByHandle(handle);
> 
> One question is whether the string returned by `GetFinalPathNameByHandle` should be used as is, or converted to some other form.

I think you just need to use the path that is passed to the readLink method, just pass it readLinkImpl.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21047#discussion_r1764461660


More information about the nio-dev mailing list