public OMElement fetchFeed()

in modules/core/src/main/java/org/apache/savan/atom/AtomEventingClient.java [141:170]


    public OMElement fetchFeed(String url) throws SavanException {
        // Create an instance of HttpClient.
        HttpClient client = new HttpClient();

        // Create a method instance.
        GetMethod method = new GetMethod(url);

        try {
            // Execute the method.
            int statusCode = client.executeMethod(method);

            if (statusCode != HttpStatus.SC_OK) {
                throw new SavanException("Method failed: " + method.getStatusLine());
            }

            // Read the response body.
            byte[] responseBody = method.getResponseBody();

            StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(
                    responseBody));
            return builder.getDocumentElement();
        } catch (IOException e) {
            throw new SavanException(e);
        } catch (XMLStreamException e) {
            throw new SavanException(e);
        } finally {
            // Release the connection.
            method.releaseConnection();
        }
    }