repo.deleteAllObjects();
// Get a handle to the repository directory and recursively
// delete it and everything inside of it.
final File repoFile = repo.getFile();
if(!deleteQuietly(repoFile)) {
throw new RepositoryDeletionException("Failed to " +
"recursively delete repository (repo=" +
repo.getRepoId() + ", file=" +
repoFile.getCanonicalPath() + ")");
}
// Delete the meta data associated with the repository too.
metaStore_.delete(repo.getKey());
return null;
}
@Override
public void success(final Void v) throws Exception {
// On deletion success, remove the repository from the
// local in-memory "cache". If the repository was not
// deleted successfully, then fail.
repositories_.invalidate(repo.getRepoId());
}
}.write(); // Exclusive lock on repo, no wait
} catch (LockConflictException e) {
throw e;
} catch (RepositoryDeletionException e) {
throw e;
} catch (Exception e) {
throw new RepositoryDeletionException("Failed to delete " +
"repository (repo=" + repo.getKey() + ")", e);
}
}