Skip to content

Native Image FileSystem is trailing slash sensitive #5080

@bclozel

Description

@bclozel

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:

  1. git clone git@github.com:bclozel/native-resources.git
  2. ./gradlew nativeCompile
  3. ./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)

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions