public void init(boolean createIfRequired) throws StorageException {
connect();
if (!testTargetExists() && createIfRequired) {
if (!repoPath.mkdir()) {
throw new StorageException("Cannot create repository directory: " + repoPath);
}
}
if (!multichunksPath.mkdir()) {
throw new StorageException("Cannot create multichunk directory: " + multichunksPath);
}
if (!databasesPath.mkdir()) {
throw new StorageException("Cannot create databases directory: " + databasesPath);
}
if (!actionsPath.mkdir()) {
throw new StorageException("Cannot create actions directory: " + actionsPath);
}
if (!transactionsPath.mkdir()) {
throw new StorageException("Cannot create transactions directory: " + transactionsPath);
}
if (!temporaryPath.mkdir()) {
throw new StorageException("Cannot create temporary directory: " + temporaryPath);
}
}