public List < URL > scanBundlesInClassSpace ( String directory , String filePattern , boolean recursive ) { Set < Bundle > bundlesInClassSpace = ClassPathUtil . getBundlesInClassSpace ( bundleClassLoader . getBundle ( ) , new HashSet <> ( ) ) ; List < URL > matching = new ArrayList <> ( ) ; for ( Bundle bundle : bundlesInClassSpace ) { @ SuppressWarnings ( "rawtypes" ) Enumeration e = bundle . findEntries ( directory , filePattern , recursive ) ; if ( e == null ) { continue ; } while ( e . hasMoreElements ( ) ) { URL u = ( URL ) e . nextElement ( ) ; matching . add ( u ) ; } } return matching ; }
Scans the imported and required bundles for matching resources . Can be used to obtain references to TLD files XML definition files etc .