Package org.apache.ftpserver.config

Examples of org.apache.ftpserver.config.PropertiesConfiguration


        props.setProperty("config.baz", "1.2.3.4");
        props.setProperty("config.myBean.class", MyBean.class.getName());
        props.setProperty("config.myBean.foo", "flopp");
        props.setProperty("config.myBean.bar", "123");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyOtherBean otherBean = (MyOtherBean) ConfigurationClassUtils.createBean(config, null);
        assertEquals(InetAddress.getByName("1.2.3.4"), otherBean.getBaz());
       
        MyBean bean = otherBean.getMyBean();
View Full Code Here


        props.setProperty("config.class", MyOtherBean.class.getName());
        props.setProperty("config.baz", "1.2.3.4");
        props.setProperty("config.myBean.foo", "flopp");
        props.setProperty("config.myBean.bar", "123");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyOtherBean otherBean = (MyOtherBean) ConfigurationClassUtils.createBean(config, null);
        assertEquals(InetAddress.getByName("1.2.3.4"), otherBean.getBaz());
       
        MyBean bean = otherBean.getMyBean();
View Full Code Here

    public void testCreateListBean() {
        Properties props = new Properties();
        props.setProperty("config.class", MyCollectionBean.class.getName());
        props.setProperty("config.list", "foo,bar, bar, flopp  ");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyCollectionBean bean = (MyCollectionBean) ConfigurationClassUtils.createBean(config, null);
       
        Iterator<?> iter = bean.getList().iterator();
       
View Full Code Here

        props.setProperty("config.list.2.class", MyBean.class.getName());
        props.setProperty("config.list.2.foo", "foo2");
        props.setProperty("config.list.3.class", MyBean.class.getName());
        props.setProperty("config.list.3.foo", "foo3");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyCollectionBean bean = (MyCollectionBean) ConfigurationClassUtils.createBean(config, null);
       
        Iterator<?> iter = bean.getList().iterator();
       
View Full Code Here

    public void testCreateArrayBean() {
        Properties props = new Properties();
        props.setProperty("config.class", MyCollectionBean.class.getName());
        props.setProperty("config.array", "1,12, 123, 1234  ");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyCollectionBean bean = (MyCollectionBean) ConfigurationClassUtils.createBean(config, null);
       
        int[] array = bean.getArray();
       
View Full Code Here

        props.setProperty("config.class", MyCollectionBean.class.getName());
        props.setProperty("config.myBeans.1.foo", "foo1");
        props.setProperty("config.myBeans.2.foo", "foo2");
        props.setProperty("config.myBeans.3.foo", "foo3");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyCollectionBean bean = (MyCollectionBean) ConfigurationClassUtils.createBean(config, null);
       
        MyBean[] array = bean.getMyBeans();
       
View Full Code Here

        Properties props = new Properties();
        props.setProperty("config.class", MyCollectionBean.class.getName());
        props.setProperty("config.myBeans.1.class", MySubBean.class.getName());
        props.setProperty("config.myBeans.1.foo", "foo1");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyCollectionBean bean = (MyCollectionBean) ConfigurationClassUtils.createBean(config, null);
       
        MyBean[] array = bean.getMyBeans();
       
View Full Code Here

       
        for(int i = 1; i<13; i++) {
            props.setProperty("config.array." + i, Integer.toString(i));
        }
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyCollectionBean bean = (MyCollectionBean) ConfigurationClassUtils.createBean(config, null);
       
        int[] array = bean.getArray();
       
View Full Code Here

        props.setProperty("config.map.foo1", "bar1");
        props.setProperty("config.map.foo2", "bar2");
        props.setProperty("config.map.foo3", "bar3");
        props.setProperty("config.map.foo4", "bar4");
       
        Configuration config = new PropertiesConfiguration(props);
       
        MyMapBean bean = (MyMapBean) ConfigurationClassUtils.createBean(config, null);
       
        Map<?, ?> map = bean.getMap();
       
View Full Code Here

        props.setProperty("config.foo3.class", MyBean.class.getName());
        props.setProperty("config.foo3.foo", "bar3");
        props.setProperty("config.foo4.class", MyBean.class.getName());
        props.setProperty("config.foo4.foo", "bar4");
       
        Configuration config = new PropertiesConfiguration(props);
       
        Map<?, ?> map = ConfigurationClassUtils.createMap(config);
       
        for(int i = 1; i<5; i++) {
            MyBean bean = (MyBean) map.get("foo" + i);
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.