params.put(RPCDefaultMessage.COLLECTION, collPath);
// TODO: In case of error get error code. Current XMLPRC does not provide place for detailed error code.
String exists = (String) runRemoteCommand("GetCollectionConfiguration", params);
if (!"yes".equals(exists)) {
throw new XMLDBException(ErrorCodes.NO_SUCH_COLLECTION,
"Collection not found: " + collPath);
}
} catch (MalformedURLException e) {
client = null;
throw new XMLDBException(ErrorCodes.INVALID_URI, e);
} catch (XMLDBException x) {
throw x; // propagate any xmldb exception.
} catch (IOException e) {
client = null;
throw new XMLDBException(ErrorCodes.UNKNOWN_ERROR, FaultCodes.GEN_GENERAL_ERROR,
"Cannot communicate with the server: " + xmlRpcURL, e);
} catch (Exception e) {
client = null;
throw new XMLDBException(ErrorCodes.UNKNOWN_ERROR, FaultCodes.JAVA_RUNTIME_ERROR,
"Collection not found: " + collPath, e);
}
}