commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Aymé (JIRA) <>
Subject [jira] Commented: (NET-159) FTPFile.getTimestamp() is off by one year
Date Fri, 01 Jun 2007 11:36:16 GMT


Julien Aymé commented on NET-159:

Hello Divyesh,

Could you please give more informations about your issue, such as:
- what is the type of the FTP server from which the file was retrived? (Unix, NTFS, Enterprise
Unix, ...) (the aim is to find out which FileEntryParser is used)
- do you specify your own Date format in a FTPConfig ?

After a quick source lookup, I found a possible scenario which would trigger the problem:
When a file entry (String) is parsed into a FTPFile, 
the FTPFile timestamp is constructed by parsing the corresponding parts of the entry.
If the date being parsed does not contain year informations, the Calendar object being constructed
has its year set to the current* year, and if this Calendar is after the current* time, its
year is reduced by one.
Here, current* is the current time of the JVM in which the code executes.

So, if the retrived file is recent enough, and if the file's server is in a different timezone
of the JVM's timezone, it is possible that the date in the file entry is after the current
date (even if it does contain year informations by the way), and thus, producing the behaviour
described above.

I hope this was not too much confusing and helped a litte,


> FTPFile.getTimestamp() is off by one year
> -----------------------------------------
>                 Key: NET-159
>                 URL:
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: winxp, jdk 1.5
>            Reporter: dangerOp
>            Priority: Minor
> The Calendar object returned by FTPFile.getTimestamp seems to be short by one year.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message