if (LOG.isDebugEnabled()) {
LOG.debug(String.format("%s %s to %s named %s", mode, xmldbUri, destCollectionUri, newName));
}
XmldbURI newNameUri = null;
try {
newNameUri = XmldbURI.xmldbUriFor(newName);
} catch (URISyntaxException ex) {
LOG.error(ex);
throw new EXistException(ex.getMessage());
}
DBBroker broker = null;
Collection srcCollection = null;
DocumentImpl srcDocument = null;
Collection destCollection = null;
TransactionManager txnManager = brokerPool.getTransactionManager();
Txn txn = txnManager.beginTransaction();
try {
broker = brokerPool.get(subject);
// Need to split path into collection and document name
XmldbURI srcCollectionUri = xmldbUri.removeLastSegment();
XmldbURI srdDocumentUri = xmldbUri.lastSegment();
// Open collection if possible, else abort
srcCollection = broker.openCollection(srcCollectionUri, Lock.WRITE_LOCK);
if (srcCollection == null) {
txnManager.abort(txn);