Skip to content

Commit bbb593d

Browse files
committed
Consistently ignore non-jar files in classpath
Closes gh-34417
1 parent b2134ee commit bbb593d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,9 @@ protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource,
843843
rootEntryPath = (jarEntry != null ? jarEntry.getName() : "");
844844
closeJarFile = !jarCon.getUseCaches();
845845
}
846-
catch (FileNotFoundException ex) {
847-
// Happens in case of cached root directory without specific subdirectory present.
846+
catch (ZipException | FileNotFoundException ex) {
847+
// Happens in case of a non-jar file or in case of a cached root directory
848+
// without specific subdirectory present, respectively.
848849
return Collections.emptySet();
849850
}
850851
}

0 commit comments

Comments
 (0)