*/
public MiltonFtpAdapter( ResourceFactory wrapped, UserManager userManager, FtpActionListener actionListener, int port, boolean autoStart ) throws FtpException {
log.debug( "creating FTP adapter on port: " + port);
this.resourceFactory = wrapped;
FtpServerFactory serverFactory = new FtpServerFactory();
ListenerFactory factory;
if( actionListener != null ) {
log.debug( "using customised milton listener factory" );
MiltonFtpHandler ftpHandler = new MiltonFtpHandler( new DefaultFtpHandler(), actionListener );
factory = new MiltonListenerFactory( ftpHandler );
} else {
factory = new ListenerFactory();
}
factory.setPort( port );
serverFactory.addListener( "default", factory.createListener() );
// VERY IMPORTANT
serverFactory.setFileSystem( this );