Package org.springframework.util

Examples of org.springframework.util.PropertiesPersister


* @author Yoav Hakman
*/
public abstract class PropertiesUtils {

    public static Properties readProperties(Resource propertiesFile) {
        PropertiesPersister propertiesPersister = new DefaultPropertiesPersister();
        Properties properties = new Properties();
        try {
            propertiesPersister.load(properties, propertiesFile.getInputStream());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return properties;
    }
View Full Code Here


    this.propertyPlaceholderConfigurer = encryptor != null ? new EncryptablePropertyPlaceholderConfigurer(encryptor) : new PropertyPlaceholderConfigurer();

    // Ensure that system properties override the spring-set properties.
    propertyPlaceholderConfigurer.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);

    PropertiesPersister savingPropertiesPersister = new DefaultPropertiesPersister() {

            @Override
            public void load(Properties props, InputStream is) throws IOException {
                props.put(HOSTNAME_KEY, HOSTNAME);
                CougarNodeId.initialiseNodeId(props);
View Full Code Here

TOP

Related Classes of org.springframework.util.PropertiesPersister

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.