-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ServletApiContext.getResourcePaths() doesn't respect the spec #10084
Comments
Interesting... The Servlet TCK doesn't actually test the Strings in the Set returned from Just that there are values. (empty set or null set are failures to the TCK) |
And https://github.com/jakartaee/servlet/blob/6.0.0/spec/src/main/asciidoc/servlet-spec-body.adoc |
The javadoc only shows an example with a trailing slash. I think we should return the trailing slash, can't see why we would not. |
Opened PR #10085 |
Thank you for being so reactive, @joakime ! And thank you for the explanation, it's very good to know, I always thought the interface reflected the official spec. (that trailing I'll definitely spend more time going through the TCK to learn more about it. :) |
…iling slash on dirs + Bring Resource.getFileName in alignment with other JVM methods of the same name. eg: Path.getFileName
…ld include trailing slash (#10085) * Issue #10084 - Directory entries on return of getResourcePaths(String) should include trailing slash * Issue #10084 - Fixing test case order of entries in collection expectation * Issue #10084 - Implementing fix for ee9 * Issue #10084 - Fixing bug in ServletContext.getRealPath() impl * Issue #10084 - Fixing tests in ee9 to make them compatible with ee8 conversion * Bring Resource.getFileName in alignment with other JVM methods of the same name. (eg: Path.getFileName)
PR #10085 is now merged into |
Jetty version(s)
12.0.0.beta3
Java version/vendor
(use: java -version)
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7, mixed mode, sharing)
OS type/version
Fedora 38
Description
I am trying to list files and directories within a
WEB-INF/
folder which has a structure similar to the one below:According to the spec, a call to
servletApiContext.getResourcePaths(/WEB-INF/)
should return:Instead, the method returns directory names without a trailing
/
:This makes it much harder to determine which entries are subdirectories and which ones aren't.
How to reproduce?
Create subdirectories in an application's
/WEB-INF/
folder and callServletApiContext.getResourcePaths("/WEB-INF/")
.The text was updated successfully, but these errors were encountered: