You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Toli Kuznets (JIRA)" <ji...@apache.org> on 2011/03/01 19:32:37 UTC

[jira] Created: (FTPSERVER-401) Provide access to last FtpReply in all Ftplet onXXX() functions

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

                 Key: FTPSERVER-401
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-401
             Project: FtpServer
          Issue Type: Improvement
          Components: Ftplets
    Affects Versions: 1.0.5
            Reporter: Toli Kuznets
            Priority: Minor


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?

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira