Package org.apache.ftpserver

Examples of org.apache.ftpserver.DefaultFtpServerContext


    private static final String UNKNOWN_PASSWORD = "bar";

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

        DefaultFtpServerContext context = (DefaultFtpServerContext) server
                .getServerContext();

        DefaultConnectionConfig cc = (DefaultConnectionConfig) context
                .getConnectionConfig();
        cc.setMaxLoginFailures(0);
        return server;
    }
View Full Code Here


    protected FtpServer createServer() throws Exception {
        assertTrue(USERS_FILE.getAbsolutePath() + " must exist", USERS_FILE
                .exists());

        DefaultFtpServerContext context = new DefaultFtpServerContext();

        NioListener listener = new NioListener();
        listener.setPort(port);
        context.setListener("default", listener);

        PropertiesUserManager userManager = new PropertiesUserManager();
        userManager.setAdminName("admin");
        userManager.setPasswordEncryptor(new ClearTextPasswordEncryptor());
        userManager.setFile(USERS_FILE);
        userManager.configure();

        context.setUserManager(userManager);

        return new FtpServer(context);
    }
View Full Code Here

public class PasvAddressWithHostnameTest extends ClientTestTemplate {

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

        DefaultFtpServerContext context = (DefaultFtpServerContext) server
                .getServerContext();

        DefaultDataConnectionConfiguration ddcc = (DefaultDataConnectionConfiguration) context
                .getListener("default").getDataConnectionConfiguration();
        ddcc.setPassiveExernalAddress(InetAddress.getByName("127.0.0.1"));

        return server;
    }
View Full Code Here

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

        DefaultFtpServerContext context = (DefaultFtpServerContext) server
                .getServerContext();

        DefaultConnectionConfig cc = (DefaultConnectionConfig) context
                .getConnectionConfig();
        cc.setAnonymousLoginEnabled(false);

        return server;
    }
View Full Code Here

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

        DefaultFtpServerContext context = (DefaultFtpServerContext) server
                .getServerContext();

        MessageResourceImpl resource = (MessageResourceImpl) context
                .getMessageResource();
        resource.setLanguages(new String[] { "en", "zh-tw" });
        return server;
    }
View Full Code Here

    private static final String UNKNOWN_PASSWORD = "bar";

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

        DefaultFtpServerContext context = (DefaultFtpServerContext) server
                .getServerContext();
        DefaultConnectionConfig cc = (DefaultConnectionConfig) context
                .getConnectionConfig();

        cc.setMaxLoginFailures(2);

        return server;
View Full Code Here

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

        FtpServer server = super.createServer();
        DefaultFtpServerContext context = (DefaultFtpServerContext) server
                .getServerContext();
        NioListener listener = (NioListener) context.getListener("default");

        listener.setImplicitSsl(useImplicit());

        DefaultSslConfiguration sslConfig = new DefaultSslConfiguration();
        sslConfig.setKeystoreFile(FTPSERVER_KEYSTORE);
View Full Code Here

        return true;
    }

    protected FtpServer createServer() throws Exception {
        FtpServer server = super.createServer();
        DefaultFtpServerContext context = (DefaultFtpServerContext) server
                .getServerContext();
        NioListener listener = (NioListener) context.getListener("default");

        DefaultSslConfiguration sslConfig = (DefaultSslConfiguration) listener
                .getSslConfiguration();
        sslConfig
                .setEnabledCipherSuites(new String[] { "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" });
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.DefaultFtpServerContext

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.