Package org.apache.ftpserver

Examples of org.apache.ftpserver.FtpServer.start()


        FtpServer server = (FtpServer) ctx.getBean("myServer");
       
        sce.getServletContext().setAttribute(FTPSERVER_CONTEXT_NAME, server);
       
        try {
            server.start();
            System.out.println("FtpServer started");
        } catch (Exception e) {
            throw new RuntimeException("Failed to start FtpServer", e);
        }
    }
View Full Code Here


        serverFactory.setUserManager(userManagerFactory.createUserManager());
       
        // start the server
        FtpServer server = serverFactory.createServer();
       
        server.start();
    }
}
View Full Code Here

        serverFactory.addListener("second", secondListener);
       
        FtpServer server = serverFactory.createServer();
       
        try {
            server.start();
           
            // Windows seems to allow for both listeners to bind on the same port...
            //fail("Must throw FtpServerConfigurationException");
        } catch(FtpServerConfigurationException e) {
            if(e.getCause() instanceof BindException) {
View Full Code Here

            }
        });

        try {
            final FtpServer ftpServer = factory.createServer();
            ftpServer.start();
            this.ftpServer = ftpServer;
        } catch (FtpException e) {
            log.error("Cannot start FTP Server", e);
        }
View Full Code Here

        serverFactory.addListener("second", secondListener);
       
        FtpServer server = serverFactory.createServer();
       
        try {
            server.start();
           
            // Windows seems to allow for both listeners to bind on the same port...
            //fail("Must throw FtpServerConfigurationException");
        } catch(FtpServerConfigurationException e) {
            if(e.getCause() instanceof BindException) {
View Full Code Here

                command = args[0];
            }
           
            if(command.equals("start")) {
                LOG.info("Starting FTP server daemon");
                server.start();
               
                synchronized (lock) {
                    lock.wait();
                }
            } else if(command.equals("stop")) {
View Full Code Here

            if(server == null) {
                return;
            }

            // start the server
            server.start();
            System.out.println("FtpServer started");

            // add shutdown hook if possible
            addShutdownHook(server);
        }
View Full Code Here

            // create root configuration object
            FtpServerContext serverContext = new ConfigurableFtpServerContext(config);

            // start the server
            FtpServer server = new FtpServer(serverContext);
            server.start();

            // add shutdown hook if possible
            addShutdownHook(server);
        }
        catch(Exception ex) {
View Full Code Here

    public void test() throws Throwable {
        XmlBeanFactory factory = new XmlBeanFactory(new FileSystemResource("src/test/resources/spring-config/config-spring-1.xml"));

        FtpServer server = (FtpServer) factory.getBean("server");
        server.start();
       
        assertEquals(500, server.getConnectionConfig().getMaxLogins());
        assertEquals(false, server.getConnectionConfig().isAnonymousLoginEnabled());
        assertEquals(123, server.getConnectionConfig().getMaxAnonymousLogins());
        assertEquals(124, server.getConnectionConfig().getMaxLoginFailures());
View Full Code Here

        serverFactory.setUserManager(userManagerFactory.createUserManager());
       
        // start the server
        FtpServer server = serverFactory.createServer();
       
        server.start();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.