Package org.springframework.util
Class SystemPropertyUtils
java.lang.Object
org.springframework.util.SystemPropertyUtils
Helper class for resolving placeholders in texts. Usually applied to file paths.
 
A text may contain ${...} placeholders, to be resolved as system properties:
 e.g. ${user.dir}. Default values can be supplied using the ":" separator
 between key and value.
- Since:
- 1.2.5
- Author:
- Juergen Hoeller, Rob Harrop, Dave Syer
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringresolvePlaceholders(String text) Resolve${...}placeholders in the given text, replacing them with corresponding system property values.static StringresolvePlaceholders(String text, boolean ignoreUnresolvablePlaceholders) Resolve${...}placeholders in the given text, replacing them with corresponding system property values.
- 
Field Details- 
PLACEHOLDER_PREFIXPrefix for system property placeholders: "${".- See Also:
 
- 
PLACEHOLDER_SUFFIXSuffix for system property placeholders: "}".- See Also:
 
- 
VALUE_SEPARATORValue separator for system property placeholders: ":".- See Also:
 
 
- 
- 
Constructor Details- 
SystemPropertyUtilspublic SystemPropertyUtils()
 
- 
- 
Method Details- 
resolvePlaceholdersResolve${...}placeholders in the given text, replacing them with corresponding system property values.- Parameters:
- text- the String to resolve
- Returns:
- the resolved String
- Throws:
- IllegalArgumentException- if there is an unresolvable placeholder
- See Also:
 
- 
resolvePlaceholdersResolve${...}placeholders in the given text, replacing them with corresponding system property values. Unresolvable placeholders with no default value are ignored and passed through unchanged if the flag is set totrue.- Parameters:
- text- the String to resolve
- ignoreUnresolvablePlaceholders- whether unresolved placeholders are to be ignored
- Returns:
- the resolved String
- Throws:
- IllegalArgumentException- if there is an unresolvable placeholder
- See Also:
 
 
-