[
https://issues.apache.org/jira/browse/NET-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13219204#comment-13219204
]
Sebb edited comment on NET-445 at 3/6/12 9:02 PM:
--------------------------------------------------
NET uses SimpleDateFormat to parse short dates; however this does not work
properly for Feb 29.
The current work-round fails for leap-years.
[Later] the problem with SimpleDateFormat is that it assumes the year is 1970 -
which was not a leap year.
The workround is to append the current year to the short date before parsing.
This works fine if the current year is a leap year, as is true of 2012.
However, if the ftp server continues to display short dates after the end of
2012, the work-round will fail at the start of 2013.
Many ftp servers only display short dates for +/- 6 months; such servers will
switch to long format dates for Feb 29 before the end of 2012, so won't be
affected.
was (Author: [email protected]):
NET uses SimpleDateFormat to parse short dates; however this does not work
properly for Feb 29.
The current work-round fails for leap-years.
Hope to have a fix soon.
> The method listFiles in FTPClient can not list these files which upload to
> FTP Server in Feb, 29 2012
> -----------------------------------------------------------------------------------------------------
>
> Key: NET-445
> URL: https://issues.apache.org/jira/browse/NET-445
> Project: Commons Net
> Issue Type: Bug
> Components: FTP
> Affects Versions: 3.0.1
> Reporter: keming.hu
>
> Before Feb, 29 2012, the method listFiles() in FTPClient.class can list all
> files in FTP Server. But today, for any file which be uploaded to FTP Server
> in Feb, 29 2012, this API can not list these files. When I change the date of
> FTP Server(it is not Feb, 29 2012), this API can list all files in FTP Server
> also.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira