
public final class StringPropertyReplacer extends Object
NOTE: Copied from jboss-common-core.jar https://github.com/jboss/jboss-common-core/blob/master/src/main/java/org/jboss/util/StringPropertyReplacer.java
| Constructor and Description |
|---|
StringPropertyReplacer() |
| Modifier and Type | Method and Description |
|---|---|
static String |
replaceClasspath(String string)
Go through the input string and replace any occurrence of ${classpath(p)} with
the classpath URL value.
|
static String |
replaceProperties(String string)
Go through the input string and replace any occurrence of ${p} with
the System.getProtocolProperty(p) value.
|
public static String replaceClasspath(String string)
string - - the string with possible ${classpath()} referencespublic static String replaceProperties(String string)
If the property reference is of the form ${p:v} and there is no such property p, then the default value v will be returned.
If the property reference is of the form ${p1,p2} or ${p1,p2:v} then the primary and the secondary properties will be tried in turn, before returning either the unchanged input, or the default value.
The property ${/} is replaced with System.getProtocolProperty("file.separator") value and the property ${:} is replaced with System.getProtocolProperty("path.separator").
Prior to resolving variables, environment variables are assigned to the collection of properties. Each environment variable is prefixed with the prefix "env.". If a system property is already defined for the prefixed environment variable, the system property is honored as an override (primarily for testing).
string - - the string with possible ${} referencesCopyright © 2021 JBoss by Red Hat. All rights reserved.