-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Constantino Cronemberger opened SPR-16146 and commented
new ClassPathResource("/test.html") removes the leading slash, but when the method createRelative is called it does not remove the leading slash in the returned resource as in this example:
System.out.println(((ClassPathResource)new ClassPathResource("").createRelative("/test.html")).getPath());
The fix is very simple.
There are two sets of constructors: the ones for when clazz is not specified and the ones for when it is specified.
The createRelative method should choose the right one to use based on the current value of the clazz attribute.
Affects: 4.3.12, 5.0.1
Issue Links:
- ResourceLoader with local "file:foo/bar/file.file" reference does not return WritableResource [SPR-16140] #20688 ResourceLoader with local "file:foo/bar/file.file" reference does not return WritableResource
Referenced from: commits 573ff2c, d00e4f1
Backported to: 4.3.13
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug