users@jersey.java.net

Re: [Jersey] Using Jersey Client API v0.8 wth GZIP Compressed stream

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 08 Oct 2008 11:20:08 +0200

On Oct 8, 2008, at 1:32 AM, amitskumar wrote:

>
> Hi
>
> Is there a way to work with Jersey client API with Compressed
> streams. Is
> there a way to get access to the Input Stream using a custom Filter.
> I would
> appreciate any pointers.
> Unfortunately we cannot use version 1.0 which has the functionality.
>
>

Hmmm... tricky. It has been a while since v0.8... i had a look and i
do not think it is possible unless you write your own equivalent of
com.sun.jersey.impl.client.urlconnection.URLConnectionClientHandler.

Basically you could duplicate the code in Jersey and register your own
when creating the client:

Client c = new Client(new MyURLConnectionClientHandler());

The inner class URLConnectionResponse can be modified such that the
getEntity method checks the
appropriate headers and wraps the InputStream from the
HttpURLConnection in an GZIPInputStream if necessary.

Paul.


>
> Regards
>
> Amit
> --
> View this message in context: http://n2.nabble.com/Using-Jersey-Client-API-v0.8-wth-GZIP-Compressed-stream-tp1305170p1305170.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>