public static synchronized final void init ( Properties props ) throws CIFSException { if ( INSTANCE != null ) { throw new CIFSException ( "Singleton context is already initialized" ) ; } Properties p = new Properties ( ) ; try { String filename = System . getProperty ( "jcifs.properties" ) ; if ( filename != null && filename . length ( ) > 1 ) { try ( FileInputStream in = new FileInputStream ( filename ) ) { p . load ( in ) ; } } } catch ( IOException ioe ) { log . error ( "Failed to load config" , ioe ) ; //$NON-NLS-1$ } p . putAll ( System . getProperties ( ) ) ; if ( props != null ) { p . putAll ( props ) ; } INSTANCE = new SingletonContext ( p ) ; }
Initialize singleton context using custom properties