@ -35,7 +35,6 @@ import java.util.jar.JarFile;
import org.apache.commons.logging.Log ;
import org.apache.commons.logging.Log ;
import org.apache.commons.logging.LogFactory ;
import org.apache.commons.logging.LogFactory ;
import org.springframework.core.io.DefaultResourceLoader ;
import org.springframework.core.io.DefaultResourceLoader ;
import org.springframework.core.io.FileSystemResource ;
import org.springframework.core.io.FileSystemResource ;
import org.springframework.core.io.Resource ;
import org.springframework.core.io.Resource ;
@ -317,9 +316,19 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
// We need to have pointers to each of the jar files on the classpath as well...
// We need to have pointers to each of the jar files on the classpath as well...
addAllClassLoaderJarRoots ( cl , result ) ;
addAllClassLoaderJarRoots ( cl , result ) ;
}
}
postProcessFindAllClassPathResourcesResult ( location , result ) ;
return result . toArray ( new Resource [ result . size ( ) ] ) ;
return result . toArray ( new Resource [ result . size ( ) ] ) ;
}
}
/ * *
* Subclass hook allowing for post processing of a
* { @link # findAllClassPathResources ( String ) findAllClassPathResources } result .
* @param location the absolute path within the classpath
* @param result a mutable set of the results which can be post processed
* /
protected void postProcessFindAllClassPathResourcesResult ( String location , Set < Resource > result ) {
}
/ * *
/ * *
* Convert the given URL as returned from the ClassLoader into a { @link Resource } .
* Convert the given URL as returned from the ClassLoader into a { @link Resource } .
* < p > The default implementation simply creates a { @link UrlResource } instance .
* < p > The default implementation simply creates a { @link UrlResource } instance .
@ -338,7 +347,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
* @param classLoader the ClassLoader to search ( including its ancestors )
* @param classLoader the ClassLoader to search ( including its ancestors )
* @param result the set of resources to add jar roots to
* @param result the set of resources to add jar roots to
* /
* /
private void addAllClassLoaderJarRoots ( ClassLoader classLoader , Set < Resource > result ) {
protected void addAllClassLoaderJarRoots ( ClassLoader classLoader , Set < Resource > result ) {
if ( classLoader instanceof URLClassLoader ) {
if ( classLoader instanceof URLClassLoader ) {
try {
try {
for ( URL url : ( ( URLClassLoader ) classLoader ) . getURLs ( ) ) {
for ( URL url : ( ( URLClassLoader ) classLoader ) . getURLs ( ) ) {