-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Un-deprecate PathResource (for java.nio.file.Path resolution in createRelative) #24211
Comments
I'm using |
As far as I can reproduce this, it is unfortunately by design: Due to the handling of trailing slashes in the Quoting the I suppose we should add the same comment to the |
It seems that our now deprecated |
I think it will be necessary to do it (un-deprecate), I just create my own to handle only |
Includes aligned createRelative signature and dedicated java.io.File test. Closes gh-24211
When creating a
FileSystemResource
with aPath
containing..
in the path, thencreateRelative
resolves to a wrong path.The problem resides on
StringUtils::applyRelativePath
method: I suggest change the method onFileSystemResource
checking first if the location is aPath
and then usePath::resolve
instead callingStringUtils::applyRelativePath
.print
../index.html
instead../xxx/dist/index.html
.Attached image shows the variables inside
FileSystemResource::createRelative
method.The text was updated successfully, but these errors were encountered: