Package org.apache.ftpserver.config

Examples of org.apache.ftpserver.config.PropertiesConfiguration


    }

    protected FtpServer createFtpServer() throws Exception {
        // get the configuration object
        Properties properties = createFtpServerProperties();
        Configuration config = new PropertiesConfiguration(properties);

        // create servce context
        FtpServerContext ftpConfig = new ConfigurableFtpServerContext(config);

        // create the server object and start it
View Full Code Here


 
  public void start() throws EmbeddableException
  {
    try
    {
      Configuration configuration = new PropertiesConfiguration( ftpProperties );
      FtpServerContext context = new ConfigurableFtpServerContext( configuration );
      server = new FtpServer( context );
      server.start();
    }
    catch (IOException e)
View Full Code Here

    }

    protected FtpServer createFtpServer() throws Exception {
        // get the configuration object
        Properties properties = createFtpServerProperties();
        Configuration config = new PropertiesConfiguration(properties);

        // create service context
        FtpServerContext ftpConfig = new ConfigurableFtpServerContext(config);

        // create the server object and start it
View Full Code Here

        Properties props = new Properties();
        props.setProperty("config.class", MockPojo.class.getName());
        props.setProperty("config.foo", "hello");
        props.setProperty("config.bar", "123");

        PropertiesConfiguration config = new PropertiesConfiguration(props);

        PojoBean bean = (PojoBean) Bean.createBean(config, null);
       
        MockPojo pojo = (MockPojo) bean.initBean();
        assertEquals("hello", pojo.foo);
View Full Code Here

                config = xmlHandler.parse();
            }
            else if( (args.length == 3) && args[1].equals("-prop") ) {
                LOG.info("Using properties configuration file " + args[2] + "...");
                in = new FileInputStream(args[2]);
                config = new PropertiesConfiguration(in);
            } else {
                throw new FtpException("Invalid configuration option");
            }
        }
        finally {
View Full Code Here

   
    public void testLifecycle() throws Exception {
        Properties props = new Properties();
        props.setProperty("config.class", MockComponent.class.getName());
        props.setProperty("config.foo", "bar");
        PropertiesConfiguration config = new PropertiesConfiguration(props);
       
        ComponentBean bean = (ComponentBean) Bean.createBean(config, null);
       
        MockComponent component = (MockComponent) bean.initBean();
        assertEquals("bar", component.config.getString("foo"));
View Full Code Here

    }
   
    public void testLifecycleDefaultClass() throws Exception {
        Properties props = new Properties();
        props.setProperty("config.foo", "bar");
        PropertiesConfiguration config = new PropertiesConfiguration(props);
       
       
        ComponentBean bean = (ComponentBean) Bean.createBean(config, MockComponent.class.getName());
       
        MockComponent component = (MockComponent) bean.initBean();
View Full Code Here

    public void testConfigListeners() throws Exception {
        Properties props = new Properties();
        props.setProperty("config.listeners.foo1.class", NioListener.class.getName());
        props.setProperty("config.listeners.foo2.class", NioListener.class.getName());
       
        Configuration config = new PropertiesConfiguration(props);
       
        ConfigurableFtpServerContext ctx = new ConfigurableFtpServerContext(config);
       
        assertNotNull(ctx.getListener("foo1"));
        assertTrue(ctx.getListener("foo1") instanceof NioListener);
View Full Code Here

                config = xmlHandler.parse();
            }
            else if( (args.length == 2) && args[0].equals("-prop") ) {
                System.out.println("Using properties configuration file " + args[1] + "...");
                in = new FileInputStream(args[1]);
                config = new PropertiesConfiguration(in);
            }
        }
        finally {
            IoUtils.close(in);
        }
View Full Code Here

        Properties props = new Properties();
        props.setProperty("config.class", MyBean.class.getName());
        props.setProperty("config.foo", "flopp");
        props.setProperty("config.bar", "123");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyBean bean = (MyBean) ConfigurationClassUtils.createBean(config, null);
        assertEquals("flopp", bean.getFoo());
        assertEquals(123, bean.getBar());
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.config.PropertiesConfiguration

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.