Package org.apache.ftpserver

Examples of org.apache.ftpserver.DefaultFtpServerContext


   
   
    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

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

    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"});

        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

    protected static final File ROOT_DIR = new File(TEST_TMP_DIR, "ftproot");
   
    protected FtpServer createServer() throws Exception {
        assertTrue(USERS_FILE.getAbsolutePath() + " must exist", USERS_FILE.exists());

        DefaultFtpServerContext context = new DefaultFtpServerContext(false);

        NioListener listener = new NioListener();
        listener.setPort(port);
        context.setListener("default", listener);
       
        PropertiesUserManager userManager = new PropertiesUserManager();
        userManager.setAdminName("admin");
        userManager.setEncryptPasswords(false);
        userManager.setPropFile(USERS_FILE);
        userManager.configure();
       
        context.setUserManager(userManager);
       
        return new FtpServer(context);       
    }
View Full Code Here

  Path ftpServerRoot = new Path(workDir, "FTPServer");
  Path ftpServerConfig = null;

  private void startServer() {
    try {
      DefaultFtpServerContext context = new DefaultFtpServerContext(false);
      MinaListener listener = new MinaListener();
      // Set port to 0 for OS to give a free port
      listener.setPort(0);
      context.setListener("default", listener);

      // Create a test user.
      UserManager userManager = context.getUserManager();
      BaseUser adminUser = new BaseUser();
      adminUser.setName("admin");
      adminUser.setPassword("admin");
      adminUser.setEnabled(true);
      adminUser.setAuthorities(new Authority[] { new WritePermission() });
View Full Code Here

  Path ftpServerRoot = new Path(workDir, "FTPServer");
  Path ftpServerConfig = null;

  private void startServer() {
    try {
      DefaultFtpServerContext context = new DefaultFtpServerContext(false);
      MinaListener listener = new MinaListener();
      // Set port to 0 for OS to give a free port
      listener.setPort(0);
      context.setListener("default", listener);

      // Create a test user.
      UserManager userManager = context.getUserManager();
      BaseUser adminUser = new BaseUser();
      adminUser.setName("admin");
      adminUser.setPassword("admin");
      adminUser.setEnabled(true);
      adminUser.setAuthorities(new Authority[] { new WritePermission() });
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.