users@jersey.java.net

Re: [Jersey] [Client API] How to obtain ETag and LastModified of received entity?

From: Markus KARG <markus.karg_at_gmx.net>
Date: Mon, 25 Aug 2008 18:51:15 +0200

Paul,
>> Currently I am doing this:
>>
>> Client client = Client.create();
>> WebResource r =
>> client.resource("http://192.168.0.15:8080/JaxRsSample/sample/Test%201%20/%201.article");
>>
>> String entity = r.get(String.class);
>>
>> How to find out the ETag and LastModified of this result?
> ClientResponse cr = r.get(ClientResponse.class);
> String entity = cr.getEntity(String.class);
> EntityTag et = cr.getEntityTag();
> Date lm = cr.getLastModified();
Cool, that is really great! It works very well!

Thanks for this code snippet! :-)

I wonder why there is no "getVia()" or "getCacheControl()" to find out
more details on the response that might be needed by the application?

Regards
Markus

-- 
http://www.xing.com/go/invita/58469