PathMatchingResourcePatternResolver no longer follows symlinks #33424
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
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 tojava.io.File.listFiles()
to a single call tojava.nio.file.Files.walk(rootPath)
. This changed the default behavior so thatPathMatchingResourcePatternResolver.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 theFileVisitOption.FOLLOW_LINKS
option like this:Files.walk(rootPath, FOLLOW_LINKS)
The text was updated successfully, but these errors were encountered: