Skip to content
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

PathMatchingResourcePatternResolver no longer follows symlinks #33424

Closed
p120ph37 opened this issue Aug 23, 2024 · 0 comments
Closed

PathMatchingResourcePatternResolver no longer follows symlinks #33424

p120ph37 opened this issue Aug 23, 2024 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Milestone

Comments

@p120ph37
Copy link

p120ph37 commented Aug 23, 2024

Affects: 6.0.x, 6.1.x


From 5.3.x to 6.0.x, the implementation of filesystem-searching in PathMatchingResourcePatternResolver was changed from a recursive call to java.io.File.listFiles() to a single call to java.nio.file.Files.walk(rootPath). This changed the default behavior so that PathMatchingResourcePatternResolver.getResources("file:./thisisasymlink/*.txt") no longer works.

The java.nio.file.Files.walk method can follow symlinks, but that behavior must be requested by supplying the FileVisitOption.FOLLOW_LINKS option like this: Files.walk(rootPath, FOLLOW_LINKS)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 23, 2024
@bclozel bclozel added the in: core Issues in core modules (aop, beans, core, context, expression) label Aug 23, 2024
@jhoeller jhoeller added type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 23, 2024
@jhoeller jhoeller added this to the 6.1.13 milestone Aug 23, 2024
@jhoeller jhoeller self-assigned this Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

4 participants