Looks like all you really want to do is change the reply messages for certain commands such as LIST, NLST etc. to include the bandwidth usage per session. The reply messages are stored in properties file named FtpStatus, optionally followed by locale for various languages. The messages and message classes are built such a way that each message can have a variable such as (client's IP or number of bytes downloaded etc). Please take a look at the LocalizedFtpReply class if you are running 1.0.x or FtpReplyTranslator if you are using the code from trunk.
Being said that, we currently do not have a way to insert arbitrary session values into the reply messages. We have discussed the possibility of adding such an option, but I can't find a JIRA issue open for that. May be you should give that a shot and see if you can get it to work. One of us can surely help you if you need assistance implementing this. The other options are - modifying/overriding the commands such as LIST and NLST to include what ever you want to add to the message. Hope this helps and makes sense. Regards, Sai Pullabhotla On Tue, Feb 23, 2010 at 7:32 PM, DevNull 43 <[email protected]> wrote: >>How about creating another method on your command which works without those >>parameters and call that? > > Ok maybe I did not explain well. > > I want to store in a session variable inside BaseUser, the amount of data > uploaded/downloaded on that particular session. > > I want to limit to 100M download and 10M upload per session. If user > disconnects and reconnects thats fine, he can upload/download again those. > > If user executes command "site sessioninfo" it will get the current > upload/download for this session. > > However I want to add the output after command does a "dir" or "nlist" or > STOR or RET. > > Example: > > ftp> dir > 200 Command PORT okay. > 150 File status okay; about to open data connection. > -rw-rw-r-- 1 FTPD FTPD 453903 Feb 24 02:16 server.log > -rw-rw-r-- 1 FTPD FTPD 54 Feb 14 12:31 Readme.txt > drwxrw-r-- 3 FTPD FTPD 4096 Feb 8 21:01 test > 226 - [Session Uploaded : 0.0Mb - 10.0 Mb left] > 226 [Session Downloaded: 17.5Mb - 82.5 Mb left] > ftp> > ftp> site sessioninfo > 226 - [Session Uploaded : 0.0Mb - 10.0 Mb left] > 226 [Session Downloaded: 17.5Mb - 82.5 Mb left] > ftp> > > > Thanks! >
