Package org.expath.httpclient

Examples of org.expath.httpclient.HttpConnection


        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 {
                    result = firstResult;
                    registerConnectionWithContext(conn);
                }
            } catch(final HttpClientException hce) {
                if(conn != null) {
                    try {
                        conn.disconnect();
                    } catch(final HttpClientException hcee) {
                        logger.warn(hcee.getMessage(), hcee);
                    }
                }
                throw hce;
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);
        } catch(final HttpClientException hce) {
            if(conn != null) {
                try {
                    conn.disconnect();
                } catch(final HttpClientException hcee) {
                    logger.warn(hcee.getMessage(), hcee);
                }
            }
            throw hce;
View Full Code Here

TOP

Related Classes of org.expath.httpclient.HttpConnection

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.