Uploaded image for project: 'FtpServer'
  1. FtpServer
  2. FTPSERVER-401

Provide access to last FtpReply in all Ftplet onXXX() functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.0.5
    • None
    • Ftplets

    Description

      It'd be great to have access to the last FtpReply in all onXXX() Ftplet functions.

      For example, I have a custom FtpLet and I wan to kick off a job on file upload, so i override the onUploadEnd() call.

      However, i get into a situation where the actual upload of data fails due to some error (in this case - firewall issues with client not being able to open an Active connection).
      The upload command errors out, but onUploadEnd() still gets called.
      However, when I get the callback, it's impossible for me to tell the difference between a "successful" upload or a callback after an
      exception when there was no physical file placed on disk.

      Looking in the debugger, I notice that the incoming FtpSession is actually a DefaultFtpSession that has an FtpIoSession that has a
      getLatReply() method that can return me something useful (REPLY_425_CANT_OPEN_DATA_CONNECTION in my case).
      However, getting to lastReply is not exposed.

      I realize that I could override afterCommand() function and store the FtpReply coming in, and then call to super.afterCommand() and then access my copy of ftpReply in onUploadEnd() but that seems like a kludge

      it'd be nicer if there was a way to get to the getLastReply() function in the incoming session to grab the last reply directly.

      I realize that changing all the Ftplet API to include a third parameter is a big switch, so maybe one can expose the FtpReply through the session?

      Attachments

        Activity

          People

            Unassigned Unassigned
            toli Toli Kuznets
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: