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?