public static synchronized IStorage openStorage ( final File pFile ) throws TTException { checkState ( existsStorage ( pFile ) , "DB could not be opened (since it was not created?) at location %s" , pFile ) ; StorageConfiguration config = StorageConfiguration . deserialize ( pFile ) ; final Storage storage = new Storage ( config ) ; final IStorage returnVal = STORAGEMAP . putIfAbsent ( pFile , storage ) ; if ( returnVal == null ) { return storage ; } else { return returnVal ; } }
Open database . A database can be opened only once . Afterwards the singleton instance bound to the File is given back .