RFR: 8355360: -d option of jwebserver command should accept relative paths [v2]

Volkan Yazici vyazici at openjdk.org
Thu May 8 11:31:56 UTC 2025


On Thu, 8 May 2025 09:21:54 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Replace `normalize().toAbsolutePath()` with `toRealPath()`
>
> src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java line 115:
> 
>> 113:                     }
>> 114:                     case "-d", "--directory" ->
>> 115:                         root = Path.of(optionArg = options.next()).normalize().toAbsolutePath();
> 
> normalize removes redundant name elements and is for "user input". Are you 100% sure it make sense here?

@AlanBateman, thanks for the review. In 5f9e3df8f607d82987ca748492e6b0468462cb14, replaced `normalize().toAbsolutePath()` with `toRealPath()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25113#discussion_r2079528637


More information about the net-dev mailing list