if(!collectionPath.startsWith("/db")) collectionPath = parent.getPath() + '/' + collectionPath; if(!destinationPath.startsWith("/db"))
collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); /*if(!destinationPath.startsWith("/db/"))
	public void copy(String collectionPath, String destinationPath, String newName)			throws XMLDBException {		if(!collectionPath.startsWith("/db"))            collectionPath = parent.getPath() + '/' + collectionPath;        if(!destinationPath.startsWith("/db"))            destinationPath = parent.getPath() + '/' + destinationPath;        System.out.println("Copying " + collectionPath + " to " + destinationPath + " as " + newName);        TransactionManager transact = brokerPool.getTransactionManager();        Txn transaction = transact.beginTransaction();        DBBroker broker = null;        org.exist.collections.Collection collection = null;        org.exist.collections.Collection destination = null;        try {            broker = brokerPool.get(user);            collection = broker.openCollection(collectionPath, Lock.READ_LOCK);            if(collection == null) {                transact.abort(transaction);                throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "Collection " + collectionPath + " not found");            }            destination = broker.openCollection(destinationPath, Lock.WRITE_LOCK);            if(destination == null) {                transact.abort(transaction);                throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION, "Collection " + destinationPath + " not found");            }            broker.copyCollection(transaction, collection, destination, newName);            transact.commit(transaction);        } catch ( EXistException e ) {            transact.abort(transaction);        	e.printStackTrace();            throw new XMLDBException( ErrorCodes.VENDOR_ERROR,                "failed to move collection " + collectionPath, e );        } catch ( PermissionDeniedException e ) {            transact.abort(transaction);            throw new XMLDBException( ErrorCodes.PERMISSION_DENIED,                e.getMessage(), e );        } catch (LockException e) {            transact.abort(transaction);            throw new XMLDBException( ErrorCodes.PERMISSION_DENIED,                    e.getMessage(), e );        } finally {        	if(collection != null) collection.release();        	if(destination != null) destination.release();            brokerPool.release( broker );        }	}