users@jersey.java.net

Re: [Jersey] jersey client and large file uploads

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 13 Aug 2009 08:45:56 +0200

Hi Igor,

If Jersey knows the size in advance the size then it will do:

                     if (size != -1 && size < Integer.MAX_VALUE) {
                         // HttpURLConnection uses the int type for
content length
                         uc.setFixedLengthStreamingMode((int)size);

Note the restriction in size. So if you POST or PUT an instance of
File whose size is less than Integer.MAX_VALUE this should work. Is it
not working for you?

In fact there is an issue with setting this because retry will not
work for authentication. So i think we require a property to ensure
that this is enabled or not.

Paul.

On Aug 13, 2009, at 7:41 AM, Igor Minar wrote:

> hi there,
>
> we noticed that if I try to upload large files via jersey client (by
> passing a input stream to the client), the jvm will run out memory
> unless we use chunked encoding.
>
> Isn't there a way to avoid chunked encoding (which just adds
> overhead in case of static content)?
>
> thanks,
> Igor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>