You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Niklas Gustavsson <ni...@protocol7.com> on 2011/04/19 13:33:58 UTC

Custom FtpSession [was: Re: Displaying a custom file structure]

On Tue, Apr 19, 2011 at 1:28 PM, Nitish Bangera
<ba...@gmail.com> wrote:
> What is the element to specify out own ftpsession for the ftpserver?

Please start a new mail thread for new subjects.

Custom FtpSessions are not currently supported and you would have to
replace NioListener and FtpHandlerAdapter to implement it, both which
are internal classes.

/niklas

Re: [proftpd] Custom FtpSession [was: Re: Displaying a custom file structure]

Posted by Allen Firstenberg <pr...@addventure.com>.
On Tue, Apr 19, 2011 at 7:33 AM, Niklas Gustavsson <ni...@protocol7.com>wrote:

> On Tue, Apr 19, 2011 at 1:28 PM, Nitish Bangera
> <ba...@gmail.com> wrote:
> > What is the element to specify out own ftpsession for the ftpserver?
>
> Custom FtpSessions are not currently supported and you would have to
> replace NioListener and FtpHandlerAdapter to implement it, both which
> are internal classes.
>
> It depends why you think you need your own FtpSession, which you didn't
state.

One thing that may be useful, however, is to add attributes to the session
using FtpSession.setAttribute() and later read them with
FtpSession.getAttribute().  Anywhere you have the session you'll be able to
access these attributes, which can include a class to do the work you desire
to subclass FtpSession.  You can create your own instance of an Ftplet and
set these attributes in the Ftplet.onConnect() method.

Allen