hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Deprecation of HttpEntity#consumeContent()
Date Wed, 02 Apr 2008 11:49:59 GMT

I would like to deprecate the #consumeContent method in the HttpEntity
interface for the following reasons:

* This method is useful (and applicable) only to one category of
entities: streaming blocking entities. It is completely useless for
buffering and simply inapplicable to non-blocking entities.
* As far as streaming entities are concerned #consumeContent is
equivalent to a trivial code snippet

InputStream instream = entity.getContent();
if (instream != null) instream.close();

This code can easily be provided out of the EntityUtils utility class.
There is no point cluttering the HttpEntity interface with a special
method that applies to a limited number of implementations.

Would anyone miss this method? If I hear no objections I'll go ahead and
deprecate HttpEntity#consumeContent.


To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message