RFR: 8355360: -d option of jwebserver command should accept relative paths
Volkan Yazici
vyazici at openjdk.org
Thu May 8 09:08:09 UTC 2025
Allows relative paths in the content root directory passed to the `jwebserver`. Changes apply to both the `jwebserver` executable and the `java -m jdk.httpserver` execution.
### Implementation notes
Received `Path` is first passed through `.normalize().toAbsolutePath()`, and then used. The rest of the logic is untouched. This effectively implies that
1. Parts that require an absolute path (e.g., `s.n.h.s.FileServerHandler`) kept their conditions
2. Logging, failures, etc. containing the user-provided directory will now refer to the _normalized absolute_ path instead of the user-provided one (can be relative, can be not normalized, etc.)
-------------
Commit messages:
- Allow relative directories in `SimpleFileServerImpl::start`
Changes: https://git.openjdk.org/jdk/pull/25113/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25113&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8355360
Stats: 126 lines in 5 files changed: 58 ins; 20 del; 48 mod
Patch: https://git.openjdk.org/jdk/pull/25113.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25113/head:pull/25113
PR: https://git.openjdk.org/jdk/pull/25113
More information about the net-dev
mailing list