Package org.apache.ftpserver

Examples of org.apache.ftpserver.FtpServerFactory


    private int passivePort;

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

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

        DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

        passivePort = TestUtil.findFreePort(12444);

        dccFactory.setPassivePorts(String.valueOf(passivePort));

        listenerFactory.setDataConnectionConfiguration(dccFactory
                .createDataConnectionConfiguration());

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

        return server;
    }
View Full Code Here


   
    private static final File TEST_FILE = new File(ROOT_DIR, TEST_FILENAME);

    @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

    private int passivePort;

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

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

        DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();

        passivePort = TestUtil.findFreePort(12444);

        dccFactory.setPassivePorts(passivePort + "-" + (passivePort + 1));

        listenerFactory.setDataConnectionConfiguration(dccFactory
                .createDataConnectionConfiguration());

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

        return server;
    }
View Full Code Here

    private static final String UNKNOWN_USERNAME = "foo";

    private static final String UNKNOWN_PASSWORD = "bar";

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

        ConnectionConfigFactory ccFactory = new ConnectionConfigFactory();

        ccFactory.setMaxLoginFailures(0);

        server.setConnectionConfig(ccFactory.createConnectionConfig());
        return server;
    }
View Full Code Here

        return false;
    }

    @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

public class IpFilterTest extends ClientTestTemplate {
 
  private DefaultIpFilter filter = new DefaultIpFilter(IpFilterType.DENY);
 
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();

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

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

*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>*
*/
public class CdCaseInsensitiveTest extends CdTest {
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();

        NativeFileSystemFactory fs = (NativeFileSystemFactory) server
                .getFileSystem();
        fs.setCaseInsensitive(true);

        return server;
    }
View Full Code Here

        return false;
    }

    @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

     * (non-Javadoc)
     *
     * @see org.apache.ftpserver.clienttests.ClientTestTemplate#createConfig()
     */
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();

        ConnectionConfigFactory ccFactory = new ConnectionConfigFactory();

        ccFactory.setAnonymousLoginEnabled(false);

        server.setConnectionConfig(ccFactory.createConnectionConfig());

        return server;
    }
View Full Code Here

     * (non-Javadoc)
     *
     * @see org.apache.ftpserver.clienttests.ClientTestTemplate#createConfig()
     */
    protected FtpServerFactory createServer() throws Exception {
        FtpServerFactory server = super.createServer();

        MessageResourceFactory factory = new MessageResourceFactory();
        factory.setLanguages(Arrays.asList(new String[] { "en", "zh-tw" }));
        server.setMessageResource(factory.createMessageResource());
       
        return server;
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.FtpServerFactory

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.