use of org.apache.jackrabbit.server.io.DeleteContextImpl in project jackrabbit by apache.
the class DavResourceImpl method removeMember.
/**
* @see DavResource#removeMember(DavResource)
*/
public void removeMember(DavResource member) throws DavException {
if (!exists() || !member.exists()) {
throw new DavException(DavServletResponse.SC_NOT_FOUND);
}
if (isLocked(this) || isLocked(member)) {
throw new DavException(DavServletResponse.SC_LOCKED);
}
// don't allow removal of nodes, that would be filtered out
if (isFilteredResource(member)) {
log.debug("Avoid removal of filtered resource: " + member.getDisplayName());
throw new DavException(DavServletResponse.SC_FORBIDDEN);
}
DeleteManager dm = config.getDeleteManager();
dm.delete(new DeleteContextImpl(getJcrSession()), member);
// make sure, non-jcr locks are removed, once the removal is completed
try {
if (!isJcrLockable()) {
ActiveLock lock = getLock(Type.WRITE, Scope.EXCLUSIVE);
if (lock != null) {
lockManager.releaseLock(lock.getToken(), member);
}
}
} catch (DavException e) {
// since check for 'locked' exception has been performed before
// ignore any error here
}
}
Aggregations