Class SystemCommandExecuterBuilder
- java.lang.Object
-
- com.github.toolarium.system.command.SystemCommandExecuterBuilder
-
public final class SystemCommandExecuterBuilder extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SystemCommandExecuterBuilder
addToCommand(java.lang.String command)
Add an additional part of the commandSystemCommandExecuterBuilder
addToCommand(java.lang.String command, java.lang.String displayCommand)
Add an additional part of the commandSystemCommandExecuterBuilder
addToCommand(java.util.Map<java.lang.String,java.lang.String> keyValueSettings, java.lang.String keyPrefix, boolean escapeValue)
Add an additional part of the command, e.g.SystemCommandExecuterBuilder
addToCommand(java.util.Map<java.lang.String,java.lang.String> keyValueSettings, java.lang.String keyPrefix, boolean escapeValue, java.util.Set<java.lang.String> senstivieSettings)
Add an additional part of the command, e.g.ISystemCommandExecuter
build()
Build the system executerstatic SystemCommandExecuterBuilder
create()
Create a new builderSystemCommandExecuterBuilder
environmentVariable(java.lang.String key, java.lang.String value)
Add an environment variableSystemCommandExecuterBuilder
shell(java.lang.String... shell)
Set the shellprotected java.lang.String
toString(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String keyPrefix, boolean escapeValue, java.util.Set<java.lang.String> senstivieSettings)
Convert a list to a stringSystemCommandExecuterBuilder
user(java.lang.String user)
Set the userSystemCommandExecuterBuilder
workingPath(java.lang.String workingPath)
Set the working path
-
-
-
Method Detail
-
create
public static SystemCommandExecuterBuilder create()
Create a new builder- Returns:
- the builder
-
shell
public SystemCommandExecuterBuilder shell(java.lang.String... shell)
Set the shell- Parameters:
shell
- the shell- Returns:
- the system command executer builder
-
user
public SystemCommandExecuterBuilder user(java.lang.String user)
Set the user- Parameters:
user
- the user- Returns:
- the system command executer builder
-
workingPath
public SystemCommandExecuterBuilder workingPath(java.lang.String workingPath)
Set the working path- Parameters:
workingPath
- the workingPath- Returns:
- the system command executer builder
-
environmentVariable
public SystemCommandExecuterBuilder environmentVariable(java.lang.String key, java.lang.String value)
Add an environment variable- Parameters:
key
- the keyvalue
- the value- Returns:
- the system command executer builder
-
addToCommand
public SystemCommandExecuterBuilder addToCommand(java.lang.String command)
Add an additional part of the command- Parameters:
command
- the additional part of the command- Returns:
- the system command executer builder
-
addToCommand
public SystemCommandExecuterBuilder addToCommand(java.lang.String command, java.lang.String displayCommand)
Add an additional part of the command- Parameters:
command
- the additional part of the commanddisplayCommand
- the additional part of the command to display- Returns:
- the system command executer builder
-
addToCommand
public SystemCommandExecuterBuilder addToCommand(java.util.Map<java.lang.String,java.lang.String> keyValueSettings, java.lang.String keyPrefix, boolean escapeValue)
Add an additional part of the command, e.g. java properties- Parameters:
keyValueSettings
- the key / value settingskeyPrefix
- the key prefix or nullescapeValue
- true to escape values- Returns:
- the system command executer builder
-
addToCommand
public SystemCommandExecuterBuilder addToCommand(java.util.Map<java.lang.String,java.lang.String> keyValueSettings, java.lang.String keyPrefix, boolean escapeValue, java.util.Set<java.lang.String> senstivieSettings)
Add an additional part of the command, e.g. java properties- Parameters:
keyValueSettings
- the key / value settingskeyPrefix
- the key prefix or nullescapeValue
- true to escape valuessenstivieSettings
- the sensitive settings- Returns:
- the system command executer builder
-
build
public ISystemCommandExecuter build()
Build the system executer- Returns:
- the system executer
-
toString
protected java.lang.String toString(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String keyPrefix, boolean escapeValue, java.util.Set<java.lang.String> senstivieSettings)
Convert a list to a string- Parameters:
map
- the mapkeyPrefix
- the key prefix or nullescapeValue
- true to escape valuessenstivieSettings
- the sensitive settings- Returns:
- the string
-
-