public static void initialize ( Configuration config , PluginManager pluginManager ) throws IllegalConfigurationException { LOCK . lock ( ) ; try { // make sure file systems are re-instantiated after re-configuration CACHE . clear ( ) ; FS_FACTORIES . clear ( ) ; Collection < Supplier < Iterator < FileSystemFactory > > > factorySuppliers = new ArrayList <> ( 2 ) ; factorySuppliers . add ( ( ) -> ServiceLoader . load ( FileSystemFactory . class ) . iterator ( ) ) ; if ( pluginManager != null ) { factorySuppliers . add ( ( ) -> pluginManager . load ( FileSystemFactory . class ) ) ; } final List < FileSystemFactory > fileSystemFactories = loadFileSystemFactories ( factorySuppliers ) ; // configure all file system factories for ( FileSystemFactory factory : fileSystemFactories ) { factory . configure ( config ) ; String scheme = factory . getScheme ( ) ; FileSystemFactory fsf = ConnectionLimitingFactory . decorateIfLimited ( factory , scheme , config ) ; FS_FACTORIES . put ( scheme , fsf ) ; } // configure the default (fallback) factory FALLBACK_FACTORY . configure ( config ) ; // also read the default file system scheme final String stringifiedUri = config . getString ( CoreOptions . DEFAULT_FILESYSTEM_SCHEME , null ) ; if ( stringifiedUri == null ) { defaultScheme = null ; } else { try { defaultScheme = new URI ( stringifiedUri ) ; } catch ( URISyntaxException e ) { throw new IllegalConfigurationException ( "The default file system scheme ('" + CoreOptions . DEFAULT_FILESYSTEM_SCHEME + "') is invalid: " + stringifiedUri , e ) ; } } } finally { LOCK . unlock ( ) ; } }
Initializes the shared file system settings .