public ResourceList getResourcesWithLeafName ( final String leafName ) { if ( closed . get ( ) ) { throw new IllegalArgumentException ( "Cannot use a ScanResult after it has been closed" ) ; } final ResourceList allWhitelistedResources = getAllResources ( ) ; if ( allWhitelistedResources . isEmpty ( ) ) { return ResourceList . EMPTY_LIST ; } else { final ResourceList filteredResources = new ResourceList ( ) ; for ( final Resource classpathResource : allWhitelistedResources ) { final String relativePath = classpathResource . getPath ( ) ; final int lastSlashIdx = relativePath . lastIndexOf ( ' ' ) ; if ( relativePath . substring ( lastSlashIdx + 1 ) . equals ( leafName ) ) { filteredResources . add ( classpathResource ) ; } } return filteredResources ; } }
Get the list of all resources found in whitelisted packages that have the requested leafname .