On Wed, Mar 11, 2009 at 4:28 PM, Raphael Bauduin <[email protected]> wrote: > On Wed, Mar 11, 2009 at 12:35 PM, Sai Pullabhotla > <[email protected]> wrote: >> By the time your Ftplet's afterCommand is called, it is too late. The server >> would have already sent the reply to the last command. So, you trying to >> send another reply would definitely mess up what the clients are expecting. >> >> What I recommend is - >> >> The messages are stored in a simple properties file. You should be able to >> make a copy of it and specify the new file in your FTPServer configuration >> (spring configuration). Modify the messages to what ever you like. I belive >> that this page in the documentation should help you in settingup custom >> messages. >> >> http://mina.apache.org/ftpserver/messages.html >> >> If you are running the Server in Embedded mode, you should be able to change >> the messages file programatically. >> >> Hope this helps. > > Interesting! I have found the file in the sources at > > apache-ftpserver-1.0.0/src/core/src/main/resources/org/apache/ftpserver/message/FtpStatus.properties > Thanks for the tip!
Btw, is there a way to put a dynamic part in the translated string? The text I want to add comes from the session object, and is unique for each session. Thanks Raphaël > > Raphaël > >> >> Sai Pullabhotla >> Phone: (402) 408-5753 >> Fax: (402) 408-6861 >> www.jMethods.com >> >> >> >> On Wed, Mar 11, 2009 at 5:22 AM, Raphael Bauduin <[email protected]> wrote: >> >>> Hi, >>> >>> I'd like to add a small information text in each reply message, and I >>> tried to do that in the afterCommand method: >>> session.write(new DefaultFtpReply(reply.code(), reply.message()+" my >>> text appended)) >>> return FtpletResult.DEFAULT >>> >>> But I get an error. On the client when logging in: >>> 421 Service not available, remote server has closed connection >>> Login failed. >>> No control connection for command: Transport endpoint is not connected >>> >>> The problem comes from writing the ftp reply to the session. But how >>> can I append some text to the reply message then? >>> >>> Thanks in advance >>> >>> Raphaël >>> >>> PS: I've also just seen that when I have my afterCommand just >>> returning FtpletResult/DEFAULT, >>> the actions in my onLogin method are not executed or have no effect (I >>> change the workingDirectory of the fsview in that mehod) >>> >>> >>> >>> -- >>> Web database: http://www.myowndb.com >>> Free Software Developers Meeting: http://www.fosdem.org >>> >> > > > > -- > Web database: http://www.myowndb.com > Free Software Developers Meeting: http://www.fosdem.org > -- Web database: http://www.myowndb.com Free Software Developers Meeting: http://www.fosdem.org
