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

[jsr339-experts] Re: restrict Request.getEntityInputStream()?

From: Bill Burke <bburke_at_redhat.com>
Date: Tue, 13 Dec 2011 09:21:47 -0500

On 12/13/11 6:14 AM, Marek Potociar wrote:
>
>
> On 12/13/2011 01:47 AM, Bill Burke wrote:
>> I don't not think Request.getEntityInputStream() should be allowed on the client side. An IllegalStateException should
>> be thrown.
>
> Why?
>

Because a request on the client only has an output stream. Only the
response on the client has an input stream.


>>
>> Also on the client, RequestBuilder.entityInputStream should be equivalent to:
>>
>> RequestBuilder.entity(inputStream);
>>
>> or also throw an IllegalStateException
>
> Makes me also wonder if we need the getEntityInputStream() method at all... Would Request.getEntity(InputStream.class)
> be a viable replacement for both, server and client side?
>

You need it for the server side as you are using the same interface for
client and server.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com