org.exist.collections.Collection collection = broker.getCollection(collectionPath);
collection = broker.openCollection(collectionPath, Lock.WRITE_LOCK);
    public void move(String collectionPath, String destinationPath,            String newName) throws XMLDBException {        if(!collectionPath.startsWith("/db"))            collectionPath = parent.getPath() + '/' + collectionPath;        if(!destinationPath.startsWith("/db"))            destinationPath = parent.getPath() + '/' + destinationPath;        DBBroker broker = null;        try {            broker = brokerPool.get(user);            org.exist.collections.Collection collection = broker.getCollection(collectionPath);            if(collection == null)                throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "Collection " + collectionPath + " not found");            org.exist.collections.Collection destination = broker.getCollection(destinationPath);            if(destination == null)                throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "Collection " + destinationPath + " not found");            broker.moveCollection(collection, destination, newName);        } catch ( EXistException e ) {        	e.printStackTrace();            throw new XMLDBException( ErrorCodes.VENDOR_ERROR,                "failed to move collection " + collectionPath, e );        } catch ( PermissionDeniedException e ) {            throw new XMLDBException( ErrorCodes.PERMISSION_DENIED,                e.getMessage(), e );        } catch (LockException e) {            throw new XMLDBException( ErrorCodes.PERMISSION_DENIED,                    e.getMessage(), e );        } finally {            brokerPool.release( broker );        }    }