/** * Return response body as {@link EventDiscovery} object. * @throws IllegalStateException when response does not represent a {@link EventDiscovery} * @throws DavException for failures in obtaining/parsing the response body */ public EventDiscovery getResponseBodyAsEventDiscovery(HttpResponse response) throws DavException { try { Document doc = getResponseBodyAsDocument(response.getEntity()); if (doc == null) { throw new DavException(response.getStatusLine().getStatusCode(), "no response body"); } return EventDiscovery.createFromXml(doc.getDocumentElement()); } catch (IOException ex) { throw new DavException(response.getStatusLine().getStatusCode(), ex); } }
/** * Return response body as {@link EventDiscovery} object. * @throws IllegalStateException when response does not represent a {@link EventDiscovery} * @throws DavException for failures in obtaining/parsing the response body */ public EventDiscovery getResponseBodyAsEventDiscovery(HttpResponse response) throws DavException { try { Document doc = getResponseBodyAsDocument(response.getEntity()); if (doc == null) { throw new DavException(response.getStatusLine().getStatusCode(), "no response body"); } return EventDiscovery.createFromXml(doc.getDocumentElement()); } catch (IOException ex) { throw new DavException(response.getStatusLine().getStatusCode(), ex); } }