tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Ward" <cw...@horizon-asset.co.uk>
Subject Getting lastModified() from a (relative) URL
Date Mon, 06 Sep 2004 10:24:38 GMT

Hi,

I'm just switching my servlets to read files using URLs rather
than fully qualified filenames - which is fine - but I can't figure
out how to get the files "last modified" value.  I can get a
lastModified
header value from the connection but I'm not reading HTML files (if this
makes any sense).

This is what I've been using to read from the relative URLs.

			URL myURL = new URL(
				req.getScheme(),
				req.getServerName(),
				req.getServerPort(),
				req.getParameter("URL")
				);
            	HttpURLConnection conn =
(HttpURLConnection)myURL.openConnection();
			...
			...

I need this info' because some of my apps' are caching files and need to
notice when they've change on disc.

Couldn't find anything in the archive.

Thanks,
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message