private static List < String > getResourcesFromDirectory ( final File directory , final Pattern searchPattern ) { final List < String > resources = new ArrayList <> ( ) ; // Filter only properties files final File [ ] fileList = directory . listFiles ( ) ; if ( fileList != null && fileList . length > 0 ) { // Iterate over each relevant file for ( final File file : fileList ) { // If the file is a directory process a recursive call to explorer the tree if ( file . isDirectory ( ) ) { resources . addAll ( getResourcesFromDirectory ( file , searchPattern ) ) ; } else { try { checkResource ( resources , searchPattern , file . getCanonicalPath ( ) ) ; } catch ( final IOException e ) { LOGGER . log ( BAD_CANONICAL_PATH , e ) ; } } } } return resources ; }
Browse a directory to search resources that match the pattern .