private void scanLibs ( List < T > factories , String libDir ) { LOG . info ( "Loading core jars from {}" , libDir ) ; List < File > files = new ArrayList <> ( ) ; try ( DirectoryStream < Path > stream = Files . newDirectoryStream ( Paths . get ( libDir ) , mExtensionPattern ) ) { for ( Path entry : stream ) { if ( entry . toFile ( ) . isFile ( ) ) { files . add ( entry . toFile ( ) ) ; } } } catch ( IOException e ) { LOG . warn ( "Failed to load libs: {}" , e . toString ( ) ) ; } scan ( files , factories ) ; }
Finds all factory from the lib directory .