Collection destination = broker.getCollection(destinationPath);
destination = broker.openCollection(destinationPath, Lock.WRITE_LOCK);
	public boolean moveResource(User user, String docPath, String destinationPath, String newName) 	throws EXistException, PermissionDeniedException {	    DBBroker broker = null;		try {			broker = brokerPool.get(user);			// get source document			int p = docPath.lastIndexOf('/');			if (p < 0 || p == docPath.length() - 1)				throw new EXistException("Illegal document path");			String collectionName = docPath.substring(0, p);			String docName = docPath.substring(p + 1);			Collection collection = broker.getCollection(collectionName);			if (collection == null)				throw new EXistException("Collection " + collectionName						+ " not found");			DocumentImpl doc = collection.getDocument(broker, docName);			if(doc == null)				throw new EXistException("Document " + docPath + " not found");						// get destination collection			Collection destination = broker.getCollection(destinationPath);			if(destination == null)			    throw new EXistException("Destination collection " + destinationPath + " not found");			broker.moveResource(doc, destination, newName);			documentCache.clear();			return true;        } catch (LockException e) {            throw new PermissionDeniedException("Could not acquire lock on document " + docPath);        } finally {			brokerPool.release(broker);		}	}