List docsToDropCache = new ArrayList();
String contentType = null;
if (document != null) {
// check document lock
if (document.getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
throw new ResourceIsLockedException("Unable to remove document. Document is locked.");
}
// check child locks of document for current session context
if (getLockManager().foreignChildLocksExists(document, getSessionContext())) {
throw new ResourceIsLockedException("Unable to remove document. Child objects of the object you want to remove are locked.");
}
// Collect document whose cache should be cleared when deletion was
// successful
if (document instanceof WGContent) {