Examples of ListenerFactory


Examples of org.apache.ftpserver.listener.ListenerFactory

    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

Examples of org.apache.ftpserver.listener.ListenerFactory

    @Override
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory serverFactory = super.createServer();
       
        // set a really short timeout
        ListenerFactory listenerFactory = new ListenerFactory(serverFactory.getListener("default"));
        listenerFactory.setIdleTimeout(1);
       
        serverFactory.addListener("default", listenerFactory.createListener());
       
        return serverFactory;
    }
View Full Code Here

Examples of org.apache.ftpserver.listener.ListenerFactory

    @Override
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();
       
        ListenerFactory factory = new ListenerFactory();
        factory.setPort(0);
       
        server.addListener("default", factory.createListener());
       
        return server;
    }
View Full Code Here

Examples of org.apache.ftpserver.listener.ListenerFactory

        FtpServerFactory serverFactory = new FtpServerFactory();

        serverFactory.setConnectionConfig(createConnectionConfigFactory()
                .createConnectionConfig());

        ListenerFactory listenerFactory = new ListenerFactory();

        listenerFactory.setPort(port);

        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

Examples of org.apache.ftpserver.listener.ListenerFactory

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

Examples of org.apache.ftpserver.listener.ListenerFactory

    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

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

Examples of org.apache.ftpserver.listener.ListenerFactory

   
    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

Examples of org.apache.ftpserver.listener.ListenerFactory

*/
public class InetAddressBlacklistTest extends ClientTestTemplate {
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();

        ListenerFactory factory = new ListenerFactory(server.getListener("default"));

        List<InetAddress> blockedAddresses = new ArrayList<InetAddress>();
        blockedAddresses.add(InetAddress.getByName("localhost"));

        factory.setBlockedAddresses(blockedAddresses);

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

Examples of org.apache.ftpserver.listener.ListenerFactory

*/
public class SubnetBlacklistTest extends ClientTestTemplate {
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();

        ListenerFactory factory = new ListenerFactory(server.getListener("default"));

        List<Subnet> blockedSubnets = new ArrayList<Subnet>();
        blockedSubnets.add(new Subnet(InetAddress.getByName("localhost"), 32));

        factory.setBlockedSubnets(blockedSubnets);

        server.addListener("default", factory.createListener());
       
        return server;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.