Example usage for org.springframework.util SystemPropertyUtils resolvePlaceholders

List of usage examples for org.springframework.util SystemPropertyUtils resolvePlaceholders

Introduction

In this page you can find the example usage for org.springframework.util SystemPropertyUtils resolvePlaceholders.

Prototype

public static String resolvePlaceholders(String text, boolean ignoreUnresolvablePlaceholders) 

Source Link

Document

Resolve ${...}} placeholders in the given text, replacing them with corresponding system property values.

Usage

From source file:org.jahia.settings.SettingsBean.java

private String interpolate(String source) {
    return source != null && source.length() > 0 && source.contains(SystemPropertyUtils.PLACEHOLDER_PREFIX)
            ? SystemPropertyUtils.resolvePlaceholders(source, true)
            : source;/*from w w  w.j av a2 s .c  o  m*/
}

From source file:org.jahia.settings.SettingsBean.java

private String getPropertyValue(String propertyName) {
    String result = properties.getProperty(propertyName);
    if (result != null && result.length() > 0 && result.contains(SystemPropertyUtils.PLACEHOLDER_PREFIX)) {
        result = SystemPropertyUtils.resolvePlaceholders(result, true);
    }//from   w ww .j  ava  2 s  .c o m
    return result;
}