hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carvalho, Ruben" <Ruben.Carva...@fmr.com>
Subject Last-Update header weird behaviour
Date Wed, 18 Feb 2009 18:43:11 GMT

Hi everybody,

I am seeing some strange behaviour when trying to get the value of the
header Last-Modified. We have the bit of code below to get the contents
of a file in a particular "location". It all works fine but sometimes
the date coming from lastModified.getValue() is the previous date when
the file was updated.

We have one file in a particular location which is changed everyday in
the morning. Then our application reads the file, displays its contents
and the value of the header Last-Update. The contents of the file are
always accurate and correct but the header sometimes isn't. Then we go
in again, make a change in the file and then the date changes.

This is the code:

HttpClient httpClient = new HttpClient();
GetMethod getMethod = new GetMethod(location);
int statusCode = httpClient.executeMethod(getMethod);

if (statusCode == HttpStatus.SC_OK) {
  InputStream is = getMethod.getResponseBodyAsStream();
  Header lastModified = getMethod.getResponseHeader("Last-Modified");

  if (lastModified != null) {

My guess would be some known issue with this version of httpclient but
can't find anything in the mailing list. Using httpclient-3.0.1 with IHS
and Websphere. Any help would be appreciated.

Ruben Carvalho
Fidelity Investments Ireland <http://www.fidelity.com> 
Parkmore East Business Park, Galway - Ireland
*	Internal	8 737 7414
*	External	+353 (0)91 747414
*	Email	Ruben.Carvalho@fmr.com

Any comments or statements made in this email are not necessarily those
of the Fidelity Technology Group, Enterprise Solutions, or any of the
Fidelity Investments group companies. The information transmitted is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received
this in error, please contact the sender and delete the material from
any computer. All e-mails sent from or to Fidelity Investments may be
subject to our monitoring procedures.

To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message