if(!resourcePath.startsWith("/db")) resourcePath = parent.getPath() + '/' + resourcePath; if(destinationPath != null)
resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); /*if(destinationPath != null)
    public void moveResource(String resourcePath, String destinationPath,            String newName) throws XMLDBException {        if(!resourcePath.startsWith("/db"))            resourcePath = parent.getPath() + '/' + resourcePath;        if(destinationPath != null)        {        	if(!destinationPath.startsWith("/db"))        		destinationPath = parent.getPath() + '/' + destinationPath;        }        else        {        	destinationPath = parent.getPath();        }        TransactionManager transact = brokerPool.getTransactionManager();        Txn transaction = transact.beginTransaction();        DBBroker broker = null;        org.exist.collections.Collection destination = null;        org.exist.collections.Collection source = null;        try {            broker = brokerPool.get(user);            int pos = resourcePath.lastIndexOf('/');    		String collName = resourcePath.substring(0, pos);    		String docName = resourcePath.substring(pos + 1);    		source = broker.openCollection(collName, Lock.WRITE_LOCK);    		if(source == null) {                transact.abort(transaction);    			throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + collName + " not found");            }    		DocumentImpl doc = source.getDocument(broker, docName);            if(doc == null) {                transact.abort(transaction);                throw new XMLDBException(ErrorCodes.NO_SUCH_RESOURCE, "Resource " + resourcePath + " 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.moveResource(transaction, doc, destination, newName);            transact.commit(transaction);        } catch ( EXistException e ) {            transact.abort(transaction);        	e.printStackTrace();            throw new XMLDBException( ErrorCodes.VENDOR_ERROR,                "failed to move resource " + resourcePath, 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(source != null)        		source.release();        	if(destination != null)        		destination.release();            brokerPool.release( broker );        }    }