3535
3636import org .apache .commons .logging .Log ;
3737import org .apache .commons .logging .LogFactory ;
38-
3938import org .springframework .core .io .DefaultResourceLoader ;
4039import org .springframework .core .io .FileSystemResource ;
4140import org .springframework .core .io .Resource ;
@@ -317,9 +316,19 @@ protected Resource[] findAllClassPathResources(String location) throws IOExcepti
317316 // We need to have pointers to each of the jar files on the classpath as well...
318317 addAllClassLoaderJarRoots (cl , result );
319318 }
319+ postProcessFindAllClassPathResourcesResult (location , result );
320320 return result .toArray (new Resource [result .size ()]);
321321 }
322322
323+ /**
324+ * Subclass hook allowing for post processing of a
325+ * {@link #findAllClassPathResources(String) findAllClassPathResources} result.
326+ * @param location the absolute path within the classpath
327+ * @param result a mutable set of the results which can be post processed
328+ */
329+ protected void postProcessFindAllClassPathResourcesResult (String location , Set <Resource > result ) {
330+ }
331+
323332 /**
324333 * Convert the given URL as returned from the ClassLoader into a {@link Resource}.
325334 * <p>The default implementation simply creates a {@link UrlResource} instance.
@@ -338,7 +347,7 @@ protected Resource convertClassLoaderURL(URL url) {
338347 * @param classLoader the ClassLoader to search (including its ancestors)
339348 * @param result the set of resources to add jar roots to
340349 */
341- private void addAllClassLoaderJarRoots (ClassLoader classLoader , Set <Resource > result ) {
350+ protected void addAllClassLoaderJarRoots (ClassLoader classLoader , Set <Resource > result ) {
342351 if (classLoader instanceof URLClassLoader ) {
343352 try {
344353 for (URL url : ((URLClassLoader ) classLoader ).getURLs ()) {
0 commit comments