Class ProcessEnvironment
- java.lang.Object
-
- com.github.toolarium.system.command.dto.env.ProcessEnvironment
-
- All Implemented Interfaces:
IProcessEnvironment
,java.io.Serializable
public class ProcessEnvironment extends java.lang.Object implements IProcessEnvironment, java.io.Serializable
Implements theIProcessEnvironment
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProcessEnvironment()
Constructor for ProcessEnvironment
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearEnvironmentVariables()
Clear the environment variablesboolean
equals(java.lang.Object obj)
java.lang.String
getArchitecture()
Get the device architecturejava.lang.String
getEnvironmentVariable(java.lang.String key)
Get the environment variable valuejava.util.Map<java.lang.String,java.lang.String>
getEnvironmentVariables()
Get the environment variablesjava.lang.String
getOS()
Get the operating systemjava.lang.String
getOSVersion()
Get the operation system versionjava.lang.String
getUser()
Get the user.java.lang.String
getWorkingPath()
Get the working pathint
hashCode()
boolean
isSudoUser()
True if the user is set to run as a sudo user.java.lang.String
setEnvironmentVariable(java.lang.String key, java.lang.String value)
Set the environment variable key / valuevoid
setEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> environmentVariables)
Set the environment variable key / valuevoid
setUser(java.lang.String user)
Set the uservoid
setWorkingPath(java.lang.String workingPath)
Set the working pathjava.lang.String
toString()
-
-
-
Method Detail
-
getUser
public java.lang.String getUser()
Description copied from interface:IProcessEnvironment
Get the user.- Specified by:
getUser
in interfaceIProcessEnvironment
- Returns:
- the user
- See Also:
IProcessEnvironment.getUser()
-
setUser
public void setUser(java.lang.String user)
Set the user- Parameters:
user
- the user
-
isSudoUser
public boolean isSudoUser()
Description copied from interface:IProcessEnvironment
True if the user is set to run as a sudo user.- Specified by:
isSudoUser
in interfaceIProcessEnvironment
- Returns:
- true if the user is set to run as a sudo user.
- See Also:
IProcessEnvironment.isSudoUser()
-
getWorkingPath
public java.lang.String getWorkingPath()
Description copied from interface:IProcessEnvironment
Get the working path- Specified by:
getWorkingPath
in interfaceIProcessEnvironment
- Returns:
- the working path
- See Also:
IProcessEnvironment.getWorkingPath()
-
setWorkingPath
public void setWorkingPath(java.lang.String workingPath)
Set the working path- Parameters:
workingPath
- the working path
-
getEnvironmentVariables
public java.util.Map<java.lang.String,java.lang.String> getEnvironmentVariables()
Description copied from interface:IProcessEnvironment
Get the environment variables- Specified by:
getEnvironmentVariables
in interfaceIProcessEnvironment
- Returns:
- the environment variables
- See Also:
IProcessEnvironment.getEnvironmentVariables()
-
getEnvironmentVariable
public java.lang.String getEnvironmentVariable(java.lang.String key)
Description copied from interface:IProcessEnvironment
Get the environment variable value- Specified by:
getEnvironmentVariable
in interfaceIProcessEnvironment
- Parameters:
key
- the key- Returns:
- the environment variable value
- See Also:
IProcessEnvironment.getEnvironmentVariable(java.lang.String)
-
setEnvironmentVariable
public java.lang.String setEnvironmentVariable(java.lang.String key, java.lang.String value)
Set the environment variable key / value- Parameters:
key
- the keyvalue
- the value- Returns:
- the previous environment variable value
-
setEnvironmentVariables
public void setEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> environmentVariables)
Set the environment variable key / value- Parameters:
environmentVariables
- the environment variables to set
-
clearEnvironmentVariables
public void clearEnvironmentVariables()
Clear the environment variables
-
getOS
public java.lang.String getOS()
Description copied from interface:IProcessEnvironment
Get the operating system- Specified by:
getOS
in interfaceIProcessEnvironment
- Returns:
- the operating system
- See Also:
IProcessEnvironment.getOS()
-
getOSVersion
public java.lang.String getOSVersion()
Description copied from interface:IProcessEnvironment
Get the operation system version- Specified by:
getOSVersion
in interfaceIProcessEnvironment
- Returns:
- the operation system version
- See Also:
IProcessEnvironment.getOSVersion()
-
getArchitecture
public java.lang.String getArchitecture()
Description copied from interface:IProcessEnvironment
Get the device architecture- Specified by:
getArchitecture
in interfaceIProcessEnvironment
- Returns:
- the device architecture
- See Also:
IProcessEnvironment.getArchitecture()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-