FtpServerFactory serverFactory = new FtpServerFactory();
serverFactory.setConnectionConfig(createConnectionConfigFactory()
.createConnectionConfig());
ListenerFactory listenerFactory = new ListenerFactory();
listenerFactory.setPort(0);
listenerFactory
.setDataConnectionConfiguration(createDataConnectionConfigurationFactory()
.createDataConnectionConfiguration());
serverFactory.addListener("default", listenerFactory.createListener());
PropertiesUserManagerFactory umFactory = new PropertiesUserManagerFactory();
umFactory.setAdminName("admin");
umFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
umFactory.setFile(USERS_FILE);