use of org.apache.ftpserver.ConnectionConfigFactory in project camel by apache.
the class FtpServerTestSupport method createFtpServerFactory.
protected FtpServerFactory createFtpServerFactory() throws Exception {
assertTrue(USERS_FILE.exists());
assertTrue("Port number is not initialized in an expected range: " + BaseServerTestSupport.port, BaseServerTestSupport.port >= 21000);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
PropertiesUserManagerFactory pumf = new PropertiesUserManagerFactory();
pumf.setAdminName("admin");
pumf.setPasswordEncryptor(new ClearTextPasswordEncryptor());
pumf.setFile(USERS_FILE);
UserManager userMgr = pumf.createUserManager();
ListenerFactory factory = new ListenerFactory();
factory.setPort(BaseServerTestSupport.port);
FtpServerFactory serverFactory = new FtpServerFactory();
serverFactory.setUserManager(userMgr);
serverFactory.setFileSystem(fsf);
serverFactory.setConnectionConfig(new ConnectionConfigFactory().createConnectionConfig());
serverFactory.addListener(DEFAULT_LISTENER, factory.createListener());
return serverFactory;
}
Aggregations