public class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkSecurity()
When the java security manager is enabled, the
checkSecurity method can be used to protect/prevent
methods being executed by unsigned code. |
static Path |
getCarbonConfigHome()
This method will return the carbon configuration directory path.
|
static Path |
getCarbonHome()
Returns the Carbon Home directory path.
|
static List<String> |
getCarbonRuntimes()
Returns a list of WSO2 Carbon Runtime names.
|
static Path |
getRuntimeConfigPath()
Get the conf path of the runtime.
|
static String |
getRuntimeName()
get the current Runtime name.
|
static Path |
getRuntimePath()
Returns the Runtime Home directory path.
|
static String |
getSystemVariableValue(String variableName,
String defaultValue)
A utility which allows reading variables from the environment or System properties.
|
static String |
getSystemVariableValue(String variableName,
String defaultValue,
Class constantClass)
A utility which allows reading variables from the environment or System properties.
|
static String |
substituteVariables(String value)
Replace system property holders in the property values.
|
public static Path getCarbonConfigHome()
public static Path getCarbonHome()
carbon.home system property is not found, gets the
CARBON_HOME_ENV system property value and sets to the carbon home.public static Path getRuntimePath()
wso2.runtime.path system property is not found, gets the
RUNTIME_PATH_ENV system property value and sets to the runtime home.public static Path getRuntimeConfigPath()
public static String getRuntimeName()
public static String substituteVariables(String value)
value - string value to substitutepublic static String getSystemVariableValue(String variableName, String defaultValue)
variableName - System/environment variable namedefaultValue - default value to be returned if the specified system variable is not specified.public static String getSystemVariableValue(String variableName, String defaultValue, Class constantClass)
variableName - System/environment variable namedefaultValue - default value to be returned if the specified system variable is not specified.constantClass - Class from which the Predefined value should be retrieved if system variable and default
value is not specified.public static void checkSecurity()
checkSecurity method can be used to protect/prevent
methods being executed by unsigned code.public static List<String> getCarbonRuntimes() throws IOException
IOException - if an I/O error occursCopyright © 2017 WSO2. All rights reserved.