public static Set < URL > getResourceOccurrenceCount ( String resource , ClassLoader classLoader ) throws IOException { // See LBCLASSIC-159 Set < URL > urlSet = new HashSet < URL > ( ) ; Enumeration < URL > urlEnum = classLoader . getResources ( resource ) ; while ( urlEnum . hasMoreElements ( ) ) { URL url = urlEnum . nextElement ( ) ; urlSet . add ( url ) ; } return urlSet ; }
Compute the number of occurrences a resource can be found by a class loader .