@Test public void testOpenStorage() throws TTException { IStorage storage = Storage.openStorage(CoreTestHelper.PATHS.PATH1.getFile()); assertTrue(storage == mStorage); assertTrue(mStorage.close()); try { Storage.openStorage(CoreTestHelper.PATHS.PATH2.getFile()); fail(); } catch (IllegalStateException exc) { } }
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; } }
Storage implements IStorage { 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; } } }
Storage implements IStorage { 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; } } private  Storage(final StorageConfiguration pStorageConf); }
Storage implements IStorage { 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; } } private  Storage(final StorageConfiguration pStorageConf); static synchronized boolean createStorage(final StorageConfiguration pStorageConfig); static synchronized void truncateStorage(final StorageConfiguration pConf); static synchronized boolean existsStorage(final File pStoragePath); @Override synchronized boolean createResource(final ResourceConfiguration pResConf); @Override synchronized boolean truncateResource(final SessionConfiguration pSesConf); static synchronized IStorage openStorage(final File pFile); @Override synchronized ISession getSession(final SessionConfiguration pSessionConf); @Override synchronized boolean close(); @Override boolean existsResource(String pResourceName); @Override String[] listResources(); @Override File getLocation(); @Override String toString(); }
Storage implements IStorage { 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; } } private  Storage(final StorageConfiguration pStorageConf); static synchronized boolean createStorage(final StorageConfiguration pStorageConfig); static synchronized void truncateStorage(final StorageConfiguration pConf); static synchronized boolean existsStorage(final File pStoragePath); @Override synchronized boolean createResource(final ResourceConfiguration pResConf); @Override synchronized boolean truncateResource(final SessionConfiguration pSesConf); static synchronized IStorage openStorage(final File pFile); @Override synchronized ISession getSession(final SessionConfiguration pSessionConf); @Override synchronized boolean close(); @Override boolean existsResource(String pResourceName); @Override String[] listResources(); @Override File getLocation(); @Override String toString();  }