users@jersey.java.net

Re: [Jersey] Re: java.io.File and conditional GETs

From: Moises Lejter <moilejter_at_gmail.com>
Date: Wed, 7 Apr 2010 16:51:01 -0500

I'm betting on the difference between your own timezone (in Etag) and GMT (in Last-Modified) ...

Moises

On Apr 7, 2010, at 4:47 PM, Rob Koberg wrote:

> (I am using Jersey 1.1.5.1)
>
> Why does the following produce different dates for the Last-Modified
> and ETag headers:
>
> Date lastMod = new Date(file.lastModified());
> return Response.ok(file)
> .tag(DateFormat.getDateInstance(DateFormat.FULL).format(lastMod))
> .lastModified(lastMod)
> .build();
>
> Firebug is showing the following in the headers:
>
> Etag "Wednesday, February 16, 2005"
> Last-Modified Thu, 17 Feb 2005 04:25:14 GMT