Package org.expath.httpclient.model.exist

Examples of org.expath.httpclient.model.exist.EXistResult


            if (href != null && ! "".equals(href) ) {
                req.setHref(href);
            }
       
            final URI uri = new URI(req.getHref());
            final EXistResult result = sendOnce(uri, req, parser);
            return result.getResult();
               
        } catch(final URISyntaxException ex ) {
            throw new XPathException("Href is not valid: " + req != null ? req.getHref() : "" + ". " + ex.getMessage(), ex);
        } catch(final HttpClientException hce) {
            throw new XPathException(hce.getMessage(), hce);
View Full Code Here


     * Authentication may require to reply to an authentication challenge,
     * by sending again the request, with credentials.
     */
    private EXistResult sendOnce(final URI uri, final HttpRequest request, final RequestParser parser) throws HttpClientException
    {
        final EXistResult result;
       
        if(parser.getSendAuth()) {
            result = sendOnceWithAuth(uri, request, parser.getCredentials());       
        } else {
            HttpConnection conn = null;
            try {
                conn = new ApacheHttpConnection(uri);
                final EXistResult firstResult = new EXistResult(context);
                final HttpResponse response = request.send(firstResult, conn, null);
                if(response.getStatus() == 401) {
                    conn.disconnect();
                    result = sendOnceWithAuth(uri, request, parser.getCredentials());
                } else {
View Full Code Here

       
        return result;
    }
   
    private EXistResult sendOnceWithAuth(final URI uri, final HttpRequest request, final HttpCredentials httpCredentials) throws HttpClientException {
        final EXistResult result = new EXistResult(getContext());
        HttpConnection conn = null;
        try {
            conn = new ApacheHttpConnection(uri);
            request.send(result, conn, httpCredentials);
            registerConnectionWithContext(conn);
View Full Code Here

TOP

Related Classes of org.expath.httpclient.model.exist.EXistResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.