public final class OperatingSystemUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
OperatingSystemUtils.DefaultEnvVarSource
Default implementation to load environment variables.
|
static interface |
OperatingSystemUtils.EnvVarSource
Defines the functionality to load a Map of environment variables.
|
Modifier and Type | Field and Description |
---|---|
private static OperatingSystemUtils.EnvVarSource |
envVarSource |
Modifier | Constructor and Description |
---|---|
private |
OperatingSystemUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.Properties |
getSystemEnvVars() |
static java.util.Properties |
getSystemEnvVars(boolean caseSensitive)
Return the shell environment variables.
|
static void |
setEnvVarSource(OperatingSystemUtils.EnvVarSource source)
Set the source object to load the environment variables from.
|
private static OperatingSystemUtils.EnvVarSource envVarSource
public static java.util.Properties getSystemEnvVars() throws java.io.IOException
java.io.IOException
public static java.util.Properties getSystemEnvVars(boolean caseSensitive) throws java.io.IOException
caseSensitive == true
, then envar
keys will all be upper-case.caseSensitive
- Whether environment variable keys should be treated case-sensitively.java.io.IOException
- in case of an error.public static void setEnvVarSource(OperatingSystemUtils.EnvVarSource source)
source
- the EnvVarSource instance that loads the environment variables.