|
|
|
@ -41,7 +41,6 @@ import java.nio.file.Path; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Enumeration; |
|
|
|
import java.util.Enumeration; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.Iterator; |
|
|
|
|
|
|
|
import java.util.LinkedHashSet; |
|
|
|
import java.util.LinkedHashSet; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.NavigableSet; |
|
|
|
import java.util.NavigableSet; |
|
|
|
@ -937,14 +936,10 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol |
|
|
|
} |
|
|
|
} |
|
|
|
Set<Resource> result = new LinkedHashSet<>(64); |
|
|
|
Set<Resource> result = new LinkedHashSet<>(64); |
|
|
|
NavigableSet<String> entriesCache = new TreeSet<>(); |
|
|
|
NavigableSet<String> entriesCache = new TreeSet<>(); |
|
|
|
Iterator<String> entryIterator = jarFile.stream().map(JarEntry::getName).sorted().iterator(); |
|
|
|
for (Enumeration<JarEntry> entries = jarFile.entries(); entries.hasMoreElements();) { |
|
|
|
while (entryIterator.hasNext()) { |
|
|
|
entriesCache.add(entries.nextElement().getName()); |
|
|
|
String entryPath = entryIterator.next(); |
|
|
|
} |
|
|
|
int entrySeparatorIndex = entryPath.indexOf(ResourceUtils.JAR_URL_SEPARATOR); |
|
|
|
for (String entryPath : entriesCache) { |
|
|
|
if (entrySeparatorIndex >= 0) { |
|
|
|
|
|
|
|
entryPath = entryPath.substring(entrySeparatorIndex + ResourceUtils.JAR_URL_SEPARATOR.length()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
entriesCache.add(entryPath); |
|
|
|
|
|
|
|
if (entryPath.startsWith(rootEntryPath)) { |
|
|
|
if (entryPath.startsWith(rootEntryPath)) { |
|
|
|
String relativePath = entryPath.substring(rootEntryPath.length()); |
|
|
|
String relativePath = entryPath.substring(rootEntryPath.length()); |
|
|
|
if (getPathMatcher().match(subPattern, relativePath)) { |
|
|
|
if (getPathMatcher().match(subPattern, relativePath)) { |
|
|
|
|