Package com.tridion.configuration
Class VariableResolverUtil
java.lang.Object
com.tridion.configuration.VariableResolverUtil
Small utility class for resolving variables in the configuration file.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetEnvironmentVariable(String variableName) static StringgetEnvironmentVariableAndDecrypt(String variableName) static StringgetPropertyFromPropertiesFile(String propertyFilePath, String propName) static StringresolveValue(String value) Resolves the variable pattern '${}' to a real value if present in the system properties.
-
Method Details
-
resolveValue
Resolves the variable pattern '${}' to a real value if present in the system properties. Supports default values using '${placeholder:-default} if placeholder is undefined, supports hidden fields using '${placeholder:-*HIDDEN*}' which prevents the value being logged for security reasons, also supports substrings before or/and after value which should be resolved 'value${placeholder}' or '${placeholder}value' or 'value${placeholder}value'.
The system properties should include the environment variables and jvm startup properties ('-D').- Parameters:
value- The potential variable value to resolve- Returns:
- The resolved value, if the input is not a (valid) variable or not present it returns the original value.
-
getEnvironmentVariable
-
getPropertyFromPropertiesFile
-
getEnvironmentVariableAndDecrypt
-