I didn't find an API to get the time when the file/resource on the HTTP
and FTP server was last modified. I can get to the raw HTTP headers
(probably same for FTP), but of course I'd like to avoid parsing them in
my code. My code is mostly protocol-agnostic right now and I'd like to
keep it that way.
Did I overlook some way to get to that info? If not, would it be
reasonable to put that into Necko? Who do you think should the API looks
like; most importantly, which interface should contain the method(s)?
I think this is currently the only way possible for HTTP.
> (probably same for FTP), but of course I'd like to avoid parsing them in
The only way I can think of for ftp is to read the listing of the
directory, send it through the nsFTPDirListingConv code and grab the
date of the right file. No headers here ...
> my code. My code is mostly protocol-agnostic right now and I'd like to
> keep it that way.
>
> Did I overlook some way to get to that info? If not, would it be
> reasonable to put that into Necko? Who do you think should the API looks
> like; most importantly, which interface should contain the method(s)?
I think that would be a completly new interface that can/should be
implemented for each protocol.
Andreas
You could QI to nsIResumableChannel, and try to get teh resumable entity,
which has the timestamp on it. Since FTP doesn't know if a server allows
resuming wihtout trying it, I think it returns resumable entities for
every file.
Maybe we need an nsIMetaInfo interface, or something....
Bradley
> nsIFile implementations!
Exposing some of the nsIFile information on a more generic interface would
be a good idea, as long as there is some way of telling the caller 'no
idea' when asked for a particular attribute.
Bradley
like NS_ERROR_NOT_IMPLEMENTED?
Yes, as long as it was documented that that 'error' code wasn't really an
error in that case.
Bradley