protected FtpServerFactory createServer() throws Exception {
assertTrue(USERS_FILE.getAbsolutePath() + " must exist", USERS_FILE
.exists());
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);
serverFactory.setUserManager(umFactory.createUserManager());
return serverFactory;
}