On Fri, Feb 26, 2010 at 1:58 PM, Sai Pullabhotla
<[email protected]> wrote:
> The first thing is to come up with a special syntax that hints the
> FtpReplyTranslator that there is a variable in the message and it
> needs to be expanded before sending the reply to the client. The
> current syntax we use is something like:
>
> {variable}
>
> some of the example variables that we currently have are -
>
> {client.ip} - evaluates to the IP address of the client
> {request.cmd} - the command portion of the request excluding any arguments
>
> I would recommend that we use variables that start with "session." to
> get any attribute from the session. So, for example, if we have an
> attribute named "bandwidthLimit" in the session (FtpIoSession), this
> value can be sent in replies using the variable
> {session.bandwidthLimit}. When the FtpReplyTranslator sees this
> variable, it first checks the first part of the variable, which is
> "session" in this case. Then it would call another utility method that
> knows how to expand session variables. The new utility method would
> simply do something like this:
>
> return String.valueOf(session.getAttribute("bandwidthLimit"));

+1 on all of this.

/niklas

Reply via email to