Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2943F10DB3 for ; Fri, 9 Aug 2013 20:11:57 +0000 (UTC) Received: (qmail 90977 invoked by uid 500); 9 Aug 2013 20:11:57 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 90950 invoked by uid 500); 9 Aug 2013 20:11:56 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 90943 invoked by uid 99); 9 Aug 2013 20:11:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Aug 2013 20:11:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Aug 2013 20:11:55 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 55D6A23889BF for ; Fri, 9 Aug 2013 20:11:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1512474 - in /httpcomponents/httpclient/trunk: httpclient-osgi/pom.xml httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java Date: Fri, 09 Aug 2013 20:11:35 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130809201135.55D6A23889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Fri Aug 9 20:11:34 2013 New Revision: 1512474 URL: http://svn.apache.org/r1512474 Log: Removed reference to o.a.http.impl.client package from o.a.http.client.utils; fixed OSGi import / export warnings Modified: httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java Modified: httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml?rev=1512474&r1=1512473&r2=1512474&view=diff ============================================================================== --- httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml (original) +++ httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml Fri Aug 9 20:11:34 2013 @@ -121,6 +121,7 @@ org.apache.http.impl.auth.*;version=${project.version}, org.apache.http.impl.cookie.*;version=${project.version}, org.apache.http.impl.conn.*;version=${project.version}, + org.apache.http.impl.execchain.*;version=${project.version} org.apache.http.impl.client.*;version=${project.version} org.apache.http.osgi.services;version=${project.version} @@ -136,6 +137,7 @@ org.osgi.service.cm, org.apache.commons.logging;version=${commons-logging.version}, org.apache.http;version=${httpcore.version}, + org.apache.http.config;version=${httpcore.version}, org.apache.http.concurrent;version=${httpcore.version}, org.apache.http.entity;version=${httpcore.version}, org.apache.http.io;version=${httpcore.version}, Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java?rev=1512474&r1=1512473&r2=1512474&view=diff ============================================================================== --- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java (original) +++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java Fri Aug 9 20:11:34 2013 @@ -26,13 +26,13 @@ */ package org.apache.http.client.utils; +import java.io.Closeable; import java.io.IOException; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.util.EntityUtils; /** @@ -109,7 +109,7 @@ public class HttpClientUtils { } finally { response.close(); } - } catch (final IOException ex) { + } catch (final IOException ignore) { } } } @@ -121,9 +121,9 @@ public class HttpClientUtils { * Example Code: * *
-     * HttpClient httpClient = null;
+     * HttpClient httpClient = HttpClients.createDefault();
      * try {
-     *   httpClient = new DefaultHttpClient(...);
+     *   httpClient.execute(request);
      * } catch (Exception e) {
      *   // error handling
      * } finally {
@@ -134,42 +134,14 @@ public class HttpClientUtils {
      * @param httpClient
      *            the HttpClient to close, may be null or already closed.
      * @since 4.2
-     *
-     * @deprecated (4.3) do not use.
      */
-    @Deprecated
     public static void closeQuietly(final HttpClient httpClient) {
         if (httpClient != null) {
-            httpClient.getConnectionManager().shutdown();
-        }
-    }
-
-    /**
-     * Unconditionally close a httpClient. Shuts down the underlying connection
-     * manager and releases the resources.
-     * 

- * Example Code: - * - *

-     * CloseableHttpClient httpClient = HttpClients.createDefault();
-     * try {
-     *   ...
-     * } catch (Exception e) {
-     *   // error handling
-     * } finally {
-     *   HttpClientUtils.closeQuietly(httpClient);
-     * }
-     * 
- * - * @param httpClient - * the HttpClient to close, may be null or already closed. - * @since 4.3 - */ - public static void closeQuietly(final CloseableHttpClient httpClient) { - if (httpClient != null) { - try { - httpClient.close(); - } catch (final IOException ex) { + if (httpClient instanceof Closeable) { + try { + ((Closeable) httpClient).close(); + } catch (final IOException ignore) { + } } } }