Package org.apache.ftpserver

Examples of org.apache.ftpserver.FtpServerFactory


* @version $Rev$, $Date$
*
*/
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

    }
   
    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

* @version $Rev$, $Date$
*
*/
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

* @version $Rev$, $Date$
*
*/
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

  @Override
  public void setUp() throws Exception {
    assertTrue(USERS_FILE.getAbsolutePath() + " must exist",
        USERS_FILE.exists());

    FtpServerFactory serverFactory = new FtpServerFactory();

    serverFactory.setConnectionConfig(new ConnectionConfigFactory()
        .createConnectionConfig());

    ListenerFactory listenerFactory = new ListenerFactory();

    listenerFactory.setPort(PORT);

    listenerFactory
        .setDataConnectionConfiguration(new DataConnectionConfigurationFactory()
            .createDataConnectionConfiguration());

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

    PropertiesUserManagerFactory umFactory = new PropertiesUserManagerFactory();
    umFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
    umFactory.setFile(USERS_FILE);

    serverFactory.setUserManager(umFactory.createUserManager());

    server = serverFactory.createServer();
    //server.start();
  }
View Full Code Here

        this(port, null);
    }

    public Server(int port, Ftplet ftplet) throws Exception
    {
        FtpServerFactory serverFactory = new FtpServerFactory();       
       
        setupListenerFactory( serverFactory, port);               
        setupUserManagerFactory(serverFactory);
        setupFtplet(serverFactory, ftplet);
       
        server = serverFactory.createServer();
        server.start();
    }
View Full Code Here

* @version $Rev$, $Date$
*
*/
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

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.