Browse Source

Consistently ignore non-jar files in classpath

Closes gh-34417
pull/34656/head
Juergen Hoeller 10 months ago
parent
commit
bbb593db48
  1. 5
      spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

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

@ -843,8 +843,9 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol @@ -843,8 +843,9 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
rootEntryPath = (jarEntry != null ? jarEntry.getName() : "");
closeJarFile = !jarCon.getUseCaches();
}
catch (FileNotFoundException ex) {
// Happens in case of cached root directory without specific subdirectory present.
catch (ZipException | FileNotFoundException ex) {
// Happens in case of a non-jar file or in case of a cached root directory
// without specific subdirectory present, respectively.
return Collections.emptySet();
}
}

Loading…
Cancel
Save