Examples of EnvironmentConfiguration


Examples of org.apache.commons.configuration.EnvironmentConfiguration

        // matching for 2 groups match ${VAR_NAME} or $VAR_NAME
        Pattern pathPattern = Pattern.compile("\\$\\{(.+?)\\}");
        Matcher matcherPattern = pathPattern.matcher(input); // get a matcher
                                                             // object
        StringBuffer sb = new StringBuffer();
        EnvironmentConfiguration config = new EnvironmentConfiguration();
        SystemConfiguration sysConfig = new SystemConfiguration();

        while (matcherPattern.find())
        {

            String confVarName = matcherPattern.group(1) != null ? matcherPattern.group(1) : matcherPattern.group(2);
            String envConfVarValue = config.getString(confVarName);
            String sysVarValue = sysConfig.getString(confVarName);

            if (envConfVarValue != null)
            {
View Full Code Here

Examples of org.apache.commons.configuration2.EnvironmentConfiguration

     * Tests whether environment variables can be queried.
     */
    @Test
    public void testLookup()
    {
        EnvironmentConfiguration envConf = new EnvironmentConfiguration();
        for (Iterator<String> it = envConf.getKeys(); it.hasNext();)
        {
            String var = it.next();
            assertEquals("Wrong value for " + var, envConf.getString(var),
                    lookup.lookup(var));
        }
    }
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.