Class OperatingSystemUtils
- java.lang.Object
-
- org.codehaus.plexus.interpolation.os.OperatingSystemUtils
-
public final class OperatingSystemUtils extends java.lang.ObjectNOTE: This class was copied from plexus-utils, to allow this library to stand completely self-contained.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOperatingSystemUtils.DefaultEnvVarSourceDefault implementation to load environment variables.static interfaceOperatingSystemUtils.EnvVarSourceDefines the functionality to load a Map of environment variables.
-
Field Summary
Fields Modifier and Type Field Description private static OperatingSystemUtils.EnvVarSourceenvVarSource
-
Constructor Summary
Constructors Modifier Constructor Description privateOperatingSystemUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.PropertiesgetSystemEnvVars()static java.util.PropertiesgetSystemEnvVars(boolean caseSensitive)Return the shell environment variables.static voidsetEnvVarSource(OperatingSystemUtils.EnvVarSource source)Set the source object to load the environment variables from.
-
-
-
Field Detail
-
envVarSource
private static OperatingSystemUtils.EnvVarSource envVarSource
-
-
Method Detail
-
getSystemEnvVars
public static java.util.Properties getSystemEnvVars() throws java.io.IOException- Throws:
java.io.IOException
-
getSystemEnvVars
public static java.util.Properties getSystemEnvVars(boolean caseSensitive) throws java.io.IOExceptionReturn the shell environment variables. IfcaseSensitive == true, then envar keys will all be upper-case.- Parameters:
caseSensitive- Whether environment variable keys should be treated case-sensitively.- Returns:
- Properties object of (possibly modified) envar keys mapped to their values.
- Throws:
java.io.IOException- in case of an error.
-
setEnvVarSource
public static void setEnvVarSource(OperatingSystemUtils.EnvVarSource source)
Set the source object to load the environment variables from. Default implementation should suffice. This is mostly for testing.- Parameters:
source- the EnvVarSource instance that loads the environment variables.- Since:
- 3.1.2
-
-