jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: Response.isEntityRetrievable() and Response.bufferEntity()

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Fri, 2 Mar 2012 16:45:23 +0000

Hi Bill
On 02/03/12 16:35, Bill Burke wrote:
> FYI, i don't get the semantics of hasEntity() and isEntityRetrievable().
> Can you give some code examples to describe both of these methods?
>
I can at least imagine that hasEntity() is a convenience utility method
which can be used instead of checking the headers, status...

But as I've already said few times, bufferEntity() &
isEntityRetrievable() overload the Response with the extra
responsibility - which is absolutely outside of the scope of Response
whose 'job' is to present the information, not to start operating on it.

Sergey

> On 3/1/12 7:19 AM, Sergey Beryozkin wrote:
>> What is the reason for having these two methods added to Response.
>> In other words, why anyone would want to call isEntityRetrievable(),
>>
>> while say Response.hasEntity() is also available ?
>>
>> Thanks, Sergey
>