This issue is extracted from a discussion within #5020, but is not strictly related.
When walking the Native Image file system, trailing slashes in paths fails the resolution.
This can be reproduced with the following sample application:
git clone git@github.com:bclozel/native-resources.git
./gradlew nativeCompile
./build/native/nativeCompile/native-resources resource:/// first/
The "problem 2" section of the README describes the following problem: resolving "/folder" or "folder" works, but the same with a trailing slash doesn't ("folder/").
I'm not sure if this is a strict requirement or if each FileSystem can behave differently; I think aligning with the default FileSystem would be still the safest bet here, unless the behavior doesn't make sense for an in-memory file system like this.
Here is my environment:
java -version
openjdk version "17.0.4" 2022-07-19
OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06)
OpenJDK 64-Bit Server VM GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06, mixed mode, sharing)
This issue is extracted from a discussion within #5020, but is not strictly related.
When walking the Native Image file system, trailing slashes in paths fails the resolution.
This can be reproduced with the following sample application:
git clone git@github.com:bclozel/native-resources.git./gradlew nativeCompile./build/native/nativeCompile/native-resources resource:/// first/The "problem 2" section of the README describes the following problem: resolving
"/folder"or"folder"works, but the same with a trailing slash doesn't ("folder/").I'm not sure if this is a strict requirement or if each
FileSystemcan behave differently; I think aligning with the defaultFileSystemwould be still the safest bet here, unless the behavior doesn't make sense for an in-memory file system like this.Here is my environment: