*/
public void removeResource(Resource res) throws XMLDBException {
if (!(res instanceof XMLResource)) {
throw new XMLDBException(ErrorCodes.INVALID_RESOURCE,
"Only XML resources supported");
}
if (res.getId() == null) {
throw new XMLDBException(ErrorCodes.VENDOR_ERROR,
"This resource is a query result and can " +
"not be removed from the database.");
}
checkOpen();
try {
Hashtable params = new Hashtable();
params.put(RPCDefaultMessage.COLLECTION, collPath);
params.put(RPCDefaultMessage.NAME, res.getId());
runRemoteCommand("RemoveDocument", params);
} catch (Exception e) {
throw new XMLDBException(ErrorCodes.NO_SUCH_RESOURCE, e);
}
}