mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Toli Kuznets (JIRA)" <j...@apache.org>
Subject [jira] Created: (FTPSERVER-401) Provide access to last FtpReply in all Ftplet onXXX() functions
Date Tue, 01 Mar 2011 18:32:37 GMT
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

        

Mime
View raw message