private final URL [ ] findResourcesByContextLoader ( ) { List < URL > list = new ArrayList < URL > ( ) ; ClassLoader classLoader = this . getClass ( ) . getClassLoader ( ) ; assert classLoader != null ; URL [ ] urls = ( ( URLClassLoader ) classLoader ) . getURLs ( ) ; for ( String fullyQualifiedClassName : classesToScan ) { String classRelativePath = fullyQualifiedClassName . replace ( "." , "/" ) ; list . addAll ( Arrays . asList ( findResourcesInUrls ( classRelativePath , urls ) ) ) ; } return list . toArray ( new URL [ list . size ( ) ] ) ; }
Scan class resources into a basePackagetoScan path .