use of org.apache.ftpserver.FtpServerFactory in project camel by apache.
the class FtpCronScheduledRoutePolicyTest method initFtpServer.
protected void initFtpServer() throws Exception {
FtpServerFactory serverFactory = new FtpServerFactory();
// setup user management to read our users.properties and use clear text passwords
File file = new File("src/test/resources/users.properties");
UserManager uman = new PropertiesUserManager(new ClearTextPasswordEncryptor(), file, "admin");
serverFactory.setUserManager(uman);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
serverFactory.setFileSystem(fsf);
ListenerFactory factory = new ListenerFactory();
factory.setPort(20128);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
}
use of org.apache.ftpserver.FtpServerFactory in project camel by apache.
the class SpringFtpEndpointTest method initFtpServer.
protected void initFtpServer() throws Exception {
FtpServerFactory serverFactory = new FtpServerFactory();
// setup user management to read our users.properties and use clear text passwords
File file = new File("src/test/resources/users.properties");
UserManager uman = new PropertiesUserManager(new ClearTextPasswordEncryptor(), file, "admin");
serverFactory.setUserManager(uman);
NativeFileSystemFactory fsf = new NativeFileSystemFactory();
fsf.setCreateHome(true);
serverFactory.setFileSystem(fsf);
ListenerFactory factory = new ListenerFactory();
factory.setPort(ftpPort);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
}
use of org.apache.ftpserver.FtpServerFactory in project camel by apache.
the class FtpsServerTestSupport method doCreateFtpServerFactory.
protected FtpServerFactory doCreateFtpServerFactory() throws Exception {
assertTrue(FTPSERVER_KEYSTORE.exists());
FtpServerFactory serverFactory = super.createFtpServerFactory();
ListenerFactory listenerFactory = new ListenerFactory(serverFactory.getListener(DEFAULT_LISTENER));
listenerFactory.setImplicitSsl(useImplicit());
listenerFactory.setSslConfiguration(createSslConfiguration().createSslConfiguration());
serverFactory.addListener(DEFAULT_LISTENER, listenerFactory.createListener());
return serverFactory;
}
use of org.apache.ftpserver.FtpServerFactory 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;
}
use of org.apache.ftpserver.FtpServerFactory in project ddf by codice.
the class FtpServerStarterTest method setup.
@Before
public void setup() {
Ftplet ftplet = mock(FtpRequestHandler.class);
ftpServerFactory = mock(FtpServerFactory.class);
listenerFactory = mock(ListenerFactory.class);
UserManager userManager = mock(UserManagerImpl.class);
sslConfigurationFactory = mock(SslConfigurationFactory.class);
defaultListener = mock(Listener.class);
server = mock(DefaultFtpServer.class, RETURNS_DEEP_STUBS);
sessions = new HashSet<>();
ftpServerStarter = new FtpServerStarter(ftplet, ftpServerFactory, listenerFactory, userManager, sslConfigurationFactory);
}
Aggregations