Package org.apache.ftpserver

Examples of org.apache.ftpserver.DefaultConnectionConfig


    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 {
      FtpServer server = super.createServer();
       
      DefaultFtpServerContext context = (DefaultFtpServerContext) server.getServerContext();
      DefaultConnectionConfig cc = (DefaultConnectionConfig) context.getConnectionConfig();

        cc.setMaxLoginFailures(2);

        return server;
    }
View Full Code Here

                throw new FtpServerConfigurationException("Unknown configuration name: " + childName);
            }
        }

        // Configure login limits
        DefaultConnectionConfig connectionConfig = new DefaultConnectionConfig();
        if(StringUtils.hasText(element.getAttribute("max-logins"))) {
            connectionConfig.setMaxLogins(SpringUtil.parseInt(element, "max-logins"));
        }
        if(StringUtils.hasText(element.getAttribute("max-anon-logins"))) {
            connectionConfig.setMaxAnonymousLogins(SpringUtil.parseInt(element, "max-anon-logins"));
        }
        if(StringUtils.hasText(element.getAttribute("anon-enabled"))) {
            connectionConfig.setAnonymousLoginEnabled(SpringUtil.parseBoolean(element, "anon-enabled", true));
        }
        if(StringUtils.hasText(element.getAttribute("max-login-failures"))) {
            connectionConfig.setMaxLoginFailures(SpringUtil.parseInt(element, "max-login-failures"));
        }
        if(StringUtils.hasText(element.getAttribute("login-failure-delay"))) {
            connectionConfig.setLoginFailureDelay(SpringUtil.parseInt(element, "login-failure-delay"));
        }
       
        builder.addPropertyValue("connectionConfig", connectionConfig);

    }
View Full Code Here

    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

        FtpServer server = super.createServer();

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

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

        FtpServer server = super.createServer();

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

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

        return server;
    }
View Full Code Here

    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

                        "Unknown configuration name: " + childName);
            }
        }

        // Configure login limits
        DefaultConnectionConfig connectionConfig = new DefaultConnectionConfig();
        if (StringUtils.hasText(element.getAttribute("max-logins"))) {
            connectionConfig.setMaxLogins(SpringUtil.parseInt(element,
                    "max-logins"));
        }
        if (StringUtils.hasText(element.getAttribute("max-anon-logins"))) {
            connectionConfig.setMaxAnonymousLogins(SpringUtil.parseInt(element,
                    "max-anon-logins"));
        }
        if (StringUtils.hasText(element.getAttribute("anon-enabled"))) {
            connectionConfig.setAnonymousLoginEnabled(SpringUtil.parseBoolean(
                    element, "anon-enabled", true));
        }
        if (StringUtils.hasText(element.getAttribute("max-login-failures"))) {
            connectionConfig.setMaxLoginFailures(SpringUtil.parseInt(element,
                    "max-login-failures"));
        }
        if (StringUtils.hasText(element.getAttribute("login-failure-delay"))) {
            connectionConfig.setLoginFailureDelay(SpringUtil.parseInt(element,
                    "login-failure-delay"));
        }

        builder.addPropertyValue("connectionConfig", connectionConfig);
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.DefaultConnectionConfig

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.