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

FTPListParseEngine should support listing via MLSD

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.6
    • 3.7
    • FTP
    • None

    Description

      When using FTPClient#initiateListParsing, one can kind of "lazy" scroll over a FTP directory, acquiring FTPFile(s) in chunks using an iterator style pattern. The underlying code uses the LIST command.

      One drawback of the LIST command though is, that depending on the OS of the server, the results might show different precision for file modification/creation dates of files and directories.

      When working with those timestamps in directories with a growing history of files, the timestamps "change" after a file gets older and older. This can lead to problems in the consumer of the FTP files.

      One solution is, to use MLSD instead, as this (if supported by the FTP) results in much more precise timestamps regardless of a file's age.

      FTPClient does offer methods to use MLSD (FTPClient#mlistDir for example) instead, which do result in the desired outcome (precise timestamps).

      Sadly the FTPClient API does not offer a public method for using the chunkwise iterator-style FTPListParseEngine along with the MLSD command, although it looks like it could be simply achievable when just exposing some methods to public visibility.

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            skombijohn Chris Steingen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified