Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-190

[FTP Client] Not listing files with 'invalid' date

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      FTP Gateway: Response: 331-httpiproxy2 FTP server (Version 1.9.2.4 - 2005/01/11 13:03:28) ready.
      FTP Server: Response: 215 UNIX Type: L8
      FTP Client: Jakarta Commons VFS over Jakarta Commons NET

      Description

      When trying to list files in a FTP directory with two files returns 0 FileObjects.

      With another FTP client.... response is:
      ftp> ls
      227 Entering Passive Mode (212,163,35,155,160,40)
      150 Conexión de datos aceptada
      rw-rr- 1 0 0 222 Feb 29 09:47 AYC01R
      rw-rr- 1 0 0 688 Feb 29 03:04 AYC02R
      226-Options: -l
      226 2 ocurrencias en total

      ... so there are two files with date "FEBRUARY 29" (2008 is a leap year)

      When listing files with Jakarta Commons VFS over Jakarta Commons NET it returns 0 files.

      I revised Commons Net source and I found in 'org.apache.commons.net.ftp.parser.UnixFTPEntryParser' the following code:
      try

      { file.setTimestamp(super.parseTimestamp(datestr)); }

      catch (ParseException e)

      { return null; // this is a parsing failure too. }

      So I guess maybe the timestamp parser is throwing a ParseException (perhaps it's guessing a incorrect year) and in this case is returning NULL so the calling class is ignoring these files with 'Feb 29' date.

      I think this behaviour is incorrect and must be fixed. If date is considered invalid it would throw an exception,... not simply ignore the file.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                diego.souto Diego Souto
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 3h
                  3h
                  Remaining:
                  Remaining Estimate - 3h
                  3h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified