Description
When constructing a locationPattern for Spring's PathMatchingResourcePatternResolver in SysONLibraryLoader using a Path object (e.g., Paths.get("name/library")), the resulting path string contains backslashes (\) on Windows. This breaks resource resolution in JAR files and the classpath, as JARs and Spring's resource loaders only accept forward slashes (/) for paths.
Current Behavior
- On Windows,
Paths.get("name", "library").toString() returns name\library.
- When used in a
locationPattern like classpath*:name\library/*.json, Spring fails to find the resource because:
- JAR files internally use
/ as separators.
- Spring's
PathMatchingResourcePatternResolver expects / in classpath patterns.
Expected Behavior
The locationPattern should always use / as a separator, regardless of the operating system, to ensure compatibility with:
- JAR files.
- Spring's resource resolution.
- Cross-platform deployments.
Description
When constructing a
locationPatternfor Spring'sPathMatchingResourcePatternResolverinSysONLibraryLoaderusing aPathobject (e.g.,Paths.get("name/library")), the resulting path string contains backslashes (\) on Windows. This breaks resource resolution in JAR files and the classpath, as JARs and Spring's resource loaders only accept forward slashes (/) for paths.Current Behavior
Paths.get("name", "library").toString()returnsname\library.locationPatternlikeclasspath*:name\library/*.json, Spring fails to find the resource because:/as separators.PathMatchingResourcePatternResolverexpects/in classpath patterns.Expected Behavior
The
locationPatternshould always use/as a separator, regardless of the operating system, to ensure compatibility with: