Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.DefaultConfigurationBuilder$ConfigurationDeclaration


    protected void configureAbstractJdbcUsersRepository(AbstractJdbcUsersRepository res, String tableString) throws Exception {
        res.setFileSystem(new MockFileSystem());
        DataSource dataSource = getDataSource();
        res.setDatasource(dataSource);
        DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
        configuration.addProperty("[@destinationURL]", "db://maildb/" + tableString);
        configuration.addProperty("sqlFile", "file://conf/sqlResources.xml");
        res.setLog(LoggerFactory.getLogger("MockLog"));
        res.configure(configuration);
        res.init();
    }
View Full Code Here


        try {
            if (filestore != null) {

                // prepare Configurations for stream repositories
                DefaultConfigurationBuilder streamConfiguration = new DefaultConfigurationBuilder();

                streamConfiguration.addProperty("[@destinationURL]", filestore);

                sr = new FilePersistentStreamRepository();
                sr.setLog(getLogger());
                sr.setFileSystem(fileSystem);
                sr.configure(streamConfiguration);
View Full Code Here

        res.setFileSystem(new MockFileSystem());
        DataSource dataSource = getDataSource();

        res.setDatasource(dataSource);

        DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
        configuration.addProperty("[@destinationURL]", "db://maildb/" + tableString);
        configuration.addProperty("sqlFile", "file://conf/sqlResources.xml");
        res.setLog(LoggerFactory.getLogger("MockLog"));
        res.configure(configuration);
        res.init();
    }
View Full Code Here

            final CombinedConfiguration config = new CombinedConfiguration();
            HierarchicalConfiguration defConf = defaultConfigs.get(protocol);
            if (defConf != null) {
                config.addConfiguration(defConf);
            }
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
            builder.addProperty("[@destinationURL]", destination);
            config.addConfiguration(builder);

            try {
                // Use the classloader which is used for bean instance stuff
                Class<MailRepository> clazz = (Class<MailRepository>) getBeanFactory().getBeanClassLoader().loadClass(repClass);
View Full Code Here

    @Override
    protected UsersRepository getUsersRepository() throws Exception {
        JCRUsersRepository repos = new JCRUsersRepository();
        repos.setRepository(repository);
        DefaultConfigurationBuilder config = new DefaultConfigurationBuilder();
        config.addProperty("username", "admin");
        config.addProperty("password", "test");
        repos.configure(config);
        repos.setLog(LoggerFactory.getLogger("MockLog"));
        return repos;
    }
View Full Code Here

    private DefaultConfigurationBuilder builder;
    private MailetConfigImpl config;

    @Before
    public void setUp() throws Exception {
        builder = new DefaultConfigurationBuilder();
        config = new MailetConfigImpl();
    }
View Full Code Here

        sb.append("<state>test</state>");
        sb.append("</mailet>");

        sb.append("</processor>");

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        builder.load(new ByteArrayInputStream(sb.toString().getBytes()));
        return builder;
    }
View Full Code Here

            sb.append(state);
            sb.append("\"/>");
        }
    sb.append("</processors>");

    DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
    builder.load(new ByteArrayInputStream(sb.toString().getBytes()));
    return builder;
    }
View Full Code Here

     * @param newConfiguration
     *            the new Configuration for the mailet
     */
    @SuppressWarnings("unchecked")
    public void setConfiguration(Configuration newConfiguration) {
        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
       
        // Disable the delimiter parsing. See JAMES-1232
        builder.setDelimiterParsingDisabled(true);
        Iterator<String> keys = newConfiguration.getKeys();
        while (keys.hasNext()) {
            String key = keys.next();
            String[] values = newConfiguration.getStringArray(key);
            // See JAMES-1177
            // Need to replace ".." with "."
            // See
            // http://commons.apache.org/configuration/userguide-1.2/howto_xml.html
            // Escaping dot characters in XML tags
            key = key.replaceAll("\\.\\.", "\\.");
           
            // Convert array values to a "," delimited string value
            StringBuilder valueBuilder = new StringBuilder();
            for (int i = 0; i < values.length; i++) {
                valueBuilder.append(values[i]);
                if (i + 1 < values.length) {
                    valueBuilder.append(",");
                }
            }
            builder.addProperty(key, valueBuilder.toString());
        }

        configuration = builder;
    }
View Full Code Here

     */
    @Override
    protected UsersRepository getUsersRepository() throws Exception {
        HBaseUsersRepository userRepository = new HBaseUsersRepository();
        userRepository.setLog(LoggerFactory.getLogger("MockLog"));
        userRepository.configure(new DefaultConfigurationBuilder());
        return userRepository;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.DefaultConfigurationBuilder$ConfigurationDeclaration

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.