Carsten Ziegeler schrieb:
Steven Dolg wrote:
How about:

URL url = new URL("some url");
UrlConnection connection = url.openConnection();
connection.getLastModified();

Not sure it this really works in all cases, but appears to be quite suitable and easily extensible.

Yes, this works for many cases, but not for cases like where you have an expiry date etc. What do you mean by "easily extensible"?
url.openConnection() actually returns a subclass of URLConnection depending on the protocol of the URL. So own protocol implementations can return own subclasses that implement this (and other methods) accordingly. And - at least theoretically - provide additional methods for handling specific stuff, e.g. expiration dates.

Carsten

Reply via email to