Package net.wastl.webmail.misc

Examples of net.wastl.webmail.misc.ExpandableProperties


            lockFile = null;
            throw new IllegalStateException(
                    "Assertion failed.  Internal locking error in "
                    + getClass().getName() + '.');
        }
        final ExpandableProperties metaProperties = new ExpandableProperties();
        try {
            metaProperties.load(new FileInputStream(metaFile));
        } catch (final IOException ioe) {
            log.fatal("Failed to read meta props file '"
                    + metaFile.getAbsolutePath() + "'", ioe);
            throw new IllegalStateException("Failed to read meta props file '"
                    + metaFile.getAbsolutePath() + "'", ioe);
        }
        final Properties expandProps = new Properties();
        expandProps.setProperty("rtconfig.dir", rtConfigDir.getAbsolutePath());
        expandProps.setProperty("app.contextpath", contextPath);
        expandProps.setProperty("deployment.name", deploymentName);
        try {
            metaProperties.expand(expandProps); // Expand ${} properties
        } catch (final Throwable t) {
            log.fatal("Failed to expand properties in meta file '"
                    + metaFile.getAbsolutePath() + "'", t);
            throw new IllegalStateException(
                    "Failed to expand properties in meta file '"
                    + metaFile.getAbsolutePath() + "'", t);
        }
        String requiredKeysString;
        requiredKeysString = sc.getInitParameter("required.metaprop.keys");
        if (requiredKeysString != null) {
            final Set<String> requiredKeys = new HashSet<String>(
                    Arrays.asList(requiredKeysString.split("\\s*,\\s*", -1)));
            requiredKeys.removeAll(metaProperties.keySet());
            if (requiredKeys.size() > 0) {
                log.fatal("Meta properties file '" + metaFile.getAbsolutePath()
                        + "' missing required property(s): " + requiredKeys);
                throw new IllegalStateException("Meta properties file '"
                        + metaFile.getAbsolutePath()
View Full Code Here

TOP

Related Classes of net.wastl.webmail.misc.ExpandableProperties

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.