Package org.apache.ftpserver.listener

Examples of org.apache.ftpserver.listener.ListenerFactory


    @Override
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();
       
        ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
       
        DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

        int passivePort = TestUtil.findFreePort(12444);
       
        dccFactory.setPassivePorts(passivePort + "-" + passivePort);
       
        listenerFactory.setDataConnectionConfiguration(dccFactory.createDataConnectionConfiguration());

        server.addListener("default", listenerFactory.createListener());
       
        return server;
    }
View Full Code Here


    public void testFailStartingSecondListener() throws Exception {
        // FTPSERVER-197
       
        FtpServerFactory serverFactory = new FtpServerFactory();
       
        ListenerFactory listenerFactory = new ListenerFactory();
        listenerFactory.setPort(TestUtil.findFreePort());
       
        // let's create two listeners on the same port, second should not start
    
        Listener defaultListener = listenerFactory.createListener();
        Listener secondListener = listenerFactory.createListener();
       
       
        serverFactory.addListener("default", defaultListener);
        serverFactory.addListener("second", secondListener);
       
View Full Code Here

        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);
View Full Code Here

public class PasvAddressWithHostnameTest extends ClientTestTemplate {

    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();

        ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
       
        DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

        dccFactory.setPassiveExternalAddress("127.0.0.1");

        listenerFactory.setDataConnectionConfiguration(dccFactory.createDataConnectionConfiguration());

        server.addListener("default", listenerFactory.createListener());

        return server;
    }
View Full Code Here

   
    protected FtpServerFactory createServer() throws Exception {
        assertTrue(FTPSERVER_KEYSTORE.exists());

        FtpServerFactory server = super.createServer();
        ListenerFactory factory = new ListenerFactory(server.getListener("default"));
       
        factory.setImplicitSsl(useImplicit());

        factory.setSslConfiguration(createSslConfiguration().createSslConfiguration());
       
        server.addListener("default", factory.createListener());
       
        return server;
    }
View Full Code Here

    private String passiveAddress;

    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();

        ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
       
        DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();
       
        passiveAddress = TestUtil.findNonLocalhostIp().getHostAddress();
        dccFactory.setPassiveAddress(passiveAddress);
        dccFactory.setPassivePorts("12347");
        DataConnectionConfiguration dcc=dccFactory.createDataConnectionConfiguration();
       
        listenerFactory.setDataConnectionConfiguration(dcc);
       
        server.addListener("default", listenerFactory.createListener());
        return server;
    }
View Full Code Here

    }
   

    public DefaultFtpServerContext() {
        // create the default listener
        listeners.put("default", new ListenerFactory().createListener());
    }
View Full Code Here

    }
   

    public DefaultFtpServerContext() {
        // create the default listener
        listeners.put("default", new ListenerFactory().createListener());
    }
View Full Code Here

        NativeFileSystemFactory fsf = new NativeFileSystemFactory();
        fsf.setCreateHome(true);
        serverFactory.setFileSystem(fsf);

        ListenerFactory factory = new ListenerFactory();
        factory.setPort(20123);
        serverFactory.addListener("default", factory.createListener());

        ftpServer = serverFactory.createServer();
    }
View Full Code Here

        NativeFileSystemFactory fsf = new NativeFileSystemFactory();
        fsf.setCreateHome(true);
        serverFactory.setFileSystem(fsf);

        ListenerFactory factory = new ListenerFactory();
        factory.setPort(20125);
        serverFactory.addListener("default", factory.createListener());

        ftpServer = serverFactory.createServer();
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.listener.ListenerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.