final RepositoryItemUidLock uidLock = uid.getLock();
uidLock.lock(Action.delete);
try {
StorageItem item = null;
try {
// determine is the thing to be deleted a collection or not
item = getLocalStorage().retrieveItem(this, request);
}
catch (ItemNotFoundException ex) {
if (shouldNeglectItemNotFoundExOnDelete(request, ex)) {
item = null;
}
else {
throw ex;
}
}
if (item != null) {
// fire the event for file being deleted
eventBus().post(new RepositoryItemEventDeleteRoot(this, item));
// if we are deleting a collection, perform recursive notification about this too
if (item instanceof StorageCollectionItem) {
log.debug("deleting a collection '{}'", item.getPath());
// NEXUS-7628: If collection is being deleted, purge all of it's children from NFC
if (isNotFoundCacheActive()) {
getNotFoundCache().removeWithChildren(request.getRequestPath());
}