throw new XMLDBException(ErrorCodes.INVALID_DATABASE, "xmldb URL is not well formed:" + xmldbURI);
throw new XMLDBException(ErrorCodes.INVALID_DATABASE, "xmldb URL is not well formed:" + XmldbURI.XMLDB_URI_PREFIX + xmldbURI);
    public Collection getCollection(String xmldbURI, String user, String password)    		throws XMLDBException {      	XmldbURI uri = null;    	try {    		uri = new XmldbURI(XmldbURI.XMLDB_URI_PREFIX + xmldbURI);    	} catch (Exception e) {    		    		throw new XMLDBException(ErrorCodes.INVALID_DATABASE, "xmldb URI is not well formed:" + xmldbURI);       	}    	    	if ("direct access".equals(uri.getApiName()))    		        	return getLocalCollection(uri.getInstanceName(), user, password, uri.getCollectionName());    	else if ("xmlrpc".equals(uri.getApiName())){    		URL url = null;    		try {    			url = new URL("http", uri.getHost(), uri.getPort(), uri.getRemoteContext());    		} catch (MalformedURLException e) {        		//Should never happen        		throw new XMLDBException(ErrorCodes.INVALID_DATABASE, "xmldb URL is not well formed:" + xmldbURI);           	}    		return getRemoteCollectionFromXMLRPC(url, uri.getInstanceName(), user, password, uri.getCollectionName());    	}    	else     		throw new XMLDBException(ErrorCodes.INVALID_DATABASE, "xmldb URL is not well formed:" + xmldbURI);      }    