try {
final Collection col = broker.getCollection(currentCollection.getURI().append(name));
if(col != null) {
//delete
final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
final Txn txn = txnManager.beginTransaction();
try {
broker.removeCollection(txn, col);
txnManager.commit(txn);
} catch (final Exception e) {
txnManager.abort(txn);
listener.warn("Failed to remove deleted collection: " + name + ": " + e.getMessage());
} finally {
txnManager.close(txn);
}
}
} catch (final Exception e) {
listener.warn("Failed to remove deleted collection: " + name + ": " + e.getMessage());
}
} else if("resource".equals(type)) {
try {
final XmldbURI uri = XmldbURI.create(name);
final DocumentImpl doc = currentCollection.getDocument(broker, uri);
if (doc != null) {
final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
final Txn txn = txnManager.beginTransaction();
try {
if (doc.getResourceType() == DocumentImpl.BINARY_FILE) {
currentCollection.removeBinaryResource(txn, broker, uri);
} else {