Package org.apache.ftpserver.listener.nio

Examples of org.apache.ftpserver.listener.nio.NioListener


                throw new IllegalStateException(
                        "Usage of SessionFilter in combination with blockedAddesses/subnets is not supported. ");
            }
        }
        if (blockedAddresses != null || blockedSubnets != null) {
            return new NioListener(serverAddress, port, implicitSsl, ssl,
                    dataConnectionConfig, idleTimeout, blockedAddresses,
                    blockedSubnets);
        } else {
            return new NioListener(serverAddress, port, implicitSsl, ssl,
                    dataConnectionConfig, idleTimeout, sessionFilter);
        }
    }
View Full Code Here


public class InetAddressBlacklistTest extends ClientTestTemplate {
    protected FtpServer createServer() throws Exception {
        FtpServer server = super.createServer();
       
        NioListener listener = (NioListener) server.getServerContext().getListener("default");
       
        List<InetAddress> blockedAddresses = new ArrayList<InetAddress>();
        blockedAddresses.add(InetAddress.getByName("localhost"));
       
        listener.setBlockedAddresses(blockedAddresses);
       
        return server;
    }
View Full Code Here

public class SubnetBlacklistTest extends ClientTestTemplate {
    protected FtpServer createServer() throws Exception {
        FtpServer server = super.createServer();
       
        NioListener listener = (NioListener) server.getServerContext().getListener("default");
       
        List<Subnet> blockedSubnets = new ArrayList<Subnet>();
        blockedSubnets.add(new Subnet(InetAddress.getByName("localhost"), 32));
       
        listener.setBlockedSubnets(blockedSubnets);
       
        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);
        sslConfig.setKeystorePassword(KEYSTORE_PASSWORD);
        sslConfig.setSslProtocol(getAuthValue());
        sslConfig.setClientAuthentication(getClientAuth());
        sslConfig.setKeyPassword(KEYSTORE_PASSWORD);

        listener.setSslConfiguration(sslConfig);
       
        DefaultSslConfiguration dataSslConfig = new DefaultSslConfiguration();
        dataSslConfig.setKeystoreFile(FTPSERVER_KEYSTORE);
        dataSslConfig.setKeystorePassword(KEYSTORE_PASSWORD);
        dataSslConfig.setSslProtocol(getAuthValue());
        dataSslConfig.setClientAuthentication(getClientAuth());
        dataSslConfig.setKeyPassword(KEYSTORE_PASSWORD);
       
        DefaultDataConnectionConfiguration dataConfig = new DefaultDataConnectionConfiguration();
        dataConfig.setSslConfiguration(dataSslConfig);
       
        listener.setDataConnectionConfiguration(dataConfig);
       
        return server;
    }
View Full Code Here

    }
   
    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

      throw ex;
    }
  }

  private void createListeners() throws Exception {
    listeners.put("default", new NioListener());
  }
View Full Code Here

    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);
View Full Code Here

         if(blockedAddresses != null || blockedSubnets != null) {
           throw new IllegalStateException("Usage of IPFilter in combination with blockedAddesses/subnets is not supported. ");
         }
      }
      if(blockedAddresses != null || blockedSubnets != null) {
            return new NioListener(serverAddress, port, implicitSsl, ssl,
                dataConnectionConfig, idleTimeout, blockedAddresses, blockedSubnets);
      }
      else {
          return new NioListener(serverAddress, port, implicitSsl, ssl,
            dataConnectionConfig, idleTimeout, ipFilter);
      }
    }
View Full Code Here

      try{
        InetAddress.getByName(serverAddress);
      }catch(UnknownHostException e){
        throw new FtpServerConfigurationException("Unknown host",e);
      }
        return new NioListener(serverAddress, port, implicitSsl, ssl,
                dataConnectionConfig, idleTimeout, blockedAddresses,
                blockedSubnets);
    }
View Full Code Here

      try{
        InetAddress.getByName(serverAddress);
      }catch(UnknownHostException e){
        throw new FtpServerConfigurationException("Unknown host",e);
      }
        return new NioListener(serverAddress, port, implicitSsl, ssl,
                dataConnectionConfig, idleTimeout, blockedAddresses,
                blockedSubnets);
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.listener.nio.NioListener

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.