/* Open DB */
fObjectContainer = Db4o.openFile(config, forRestore ? getDBRestoreFilePath() : getDBFilePath());
/* Handle Fatal Error while opening DB */
if (fObjectContainer == null)
throw new PersistenceException(Messages.DBManager_UNABLE_TO_OPEN_PROFILE);
/* Keep date of last successfull profile opened */
storeProfileLastUsed();
}
/* Error opening the DB */
catch (Throwable e) {
/* Generic Error */
if (e instanceof Error)
throw (Error) e;
/* Persistence Exception */
if (e instanceof PersistenceException)
throw (PersistenceException) e;
/* Profile locked by another running instance */
if (e instanceof DatabaseFileLockedException)
throw new ProfileLockedException(e.getMessage(), e);
File file = new File(getDBFilePath());
/* Disk Full Error */
if (!file.exists())
throw new DiskFullException(Messages.DBManager_DISK_FULL_ERROR, e);
/* Permission Error */
if (!file.canRead() || (!file.canWrite()))
throw new InsufficientFilePermissionException(NLS.bind(Messages.DBManager_FILE_PERMISSION_ERROR, file), null);
/* Any other Error */
throw new PersistenceException(e);
}
}