Package org.apache.ftpserver

Examples of org.apache.ftpserver.FtpServer


    /**
     * Get the configuration object.
     */
    private static FtpServer getConfiguration(String[] args) throws Exception {

        FtpServer server = null;
        if (args == null || args.length < 2) {
            LOG.info("Using default configuration....");
            server = new FtpServer();
        } else if ((args.length == 2) && args[1].equals("-default")) {
            // supported for backwards compatibility, but not documented
            System.out
                    .println("The -default switch is deprecated, please use --default instead");
            LOG.info("Using default configuration....");
            server = new FtpServer();
        } else if ((args.length == 2) && args[1].equals("--default")) {
            LOG.info("Using default configuration....");
            server = new FtpServer();
        } else if (args.length == 2) {
            LOG.info("Using xml configuration file " + args[1] + "...");
            XmlBeanFactory bf = new XmlBeanFactory(new FileSystemResource(
                    args[1]));
            if (bf.containsBean("server")) {
View Full Code Here


    public static void main(String args[]) {

        try {

            // get configuration
            FtpServer server = getConfiguration(args);
            if (server == null) {
                return;
            }

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

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

    /**
     * Get the configuration object.
     */
    private static FtpServer getConfiguration(String[] args) throws Exception {

        FtpServer server = null;
        if (args.length == 0) {
            System.out.println("Using default configuration");
            server = new FtpServer();
        } else if ((args.length == 1) && args[0].equals("-default")) {
            // supported for backwards compatibility, but not documented
            System.out
                    .println("The -default switch is deprecated, please use --default instead");
            System.out.println("Using default configuration");
            server = new FtpServer();
        } else if ((args.length == 1) && args[0].equals("--default")) {
            System.out.println("Using default configuration");
            server = new FtpServer();
        } else if ((args.length == 1) && args[0].equals("--help")) {
            usage();
        } else if ((args.length == 1) && args[0].equals("-?")) {
            usage();
        } else if (args.length == 1) {
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.FtpServer

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.