hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1233301 - /httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
Date Thu, 19 Jan 2012 11:55:22 GMT
Author: olegk
Date: Thu Jan 19 11:55:21 2012
New Revision: 1233301

URL: http://svn.apache.org/viewvc?rev=1233301&view=rev
Log:
HTTPCORE-290: EntityUtils#closeQuietly
Contributed by Karthik K <oss.akk at gmail.com>

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java?rev=1233301&r1=1233300&r2=1233301&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
Thu Jan 19 11:55:21 2012
@@ -51,6 +51,22 @@ public final class EntityUtils {
 
     /**
      * Ensures that the entity content is fully consumed and the content stream, if exists,
+     * is closed. The process is done, <i>quietly</i> , without throwing any
IOException.
+     *
+     * @param entity
+     *
+     *
+     * @since 4.2
+     */
+    public static void consumeQuietly(final HttpEntity entity) {
+        try {
+          consume(entity);
+        } catch (IOException ioex) {
+        }
+    }
+
+    /**
+     * Ensures that the entity content is fully consumed and the content stream, if exists,
      * is closed.
      *
      * @param entity



Mime
View raw message