private static List < String > getResources ( final String classpathEntryPath , final Pattern searchPattern , final boolean cachedJar ) { final List < String > resources = new ArrayList <> ( ) ; // System.out.println("Search into "+classpathEntryPath); final File classpathEntryFile = new File ( classpathEntryPath ) ; // The classpath entry could be a jar or a folder if ( classpathEntryFile . isDirectory ( ) ) { // Browse the folder content resources . addAll ( getResourcesFromDirectory ( classpathEntryFile , searchPattern ) ) ; } else if ( classpathEntryFile . getName ( ) . endsWith ( ".jar" ) || classpathEntryFile . getName ( ) . endsWith ( ".zip" ) || cachedJar ) { // Explode and browse jar|zip content resources . addAll ( getResourcesFromJarOrZipFile ( classpathEntryFile , searchPattern ) ) ; } else { LOGGER . log ( RESOURCE_IGNORED , classpathEntryFile . getAbsolutePath ( ) ) ; } return resources ; }
Search all files that match the given Regex pattern .