Browse Source

Clean root entry path to match jar entries format in cache

Closes gh-34348
pull/34362/head
Juergen Hoeller 11 months ago
parent
commit
2df8ea94e0
  1. 2
      spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

2
spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

@ -813,6 +813,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol @@ -813,6 +813,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
NavigableSet<String> entriesCache = this.jarEntriesCache.get(jarFileUrl);
if (entriesCache != null) {
Set<Resource> result = new LinkedHashSet<>(64);
// Clean root entry path to match jar entries format without "!" separators
rootEntryPath = rootEntryPath.replace(ResourceUtils.JAR_URL_SEPARATOR, "/");
// Search sorted entries from first entry with rootEntryPath prefix
for (String entryPath : entriesCache.tailSet(rootEntryPath, false)) {
if (!entryPath.startsWith(rootEntryPath)) {

Loading…
Cancel
Save