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 SystemCommandExecuterBuilderaddToCommand(java.lang.String command)Add an additional part of the commandSystemCommandExecuterBuilderaddToCommand(java.lang.String command, java.lang.String displayCommand)Add an additional part of the commandSystemCommandExecuterBuilderaddToCommand(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.SystemCommandExecuterBuilderaddToCommand(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.ISystemCommandExecuterbuild()Build the system executerstatic SystemCommandExecuterBuildercreate()Create a new builderSystemCommandExecuterBuilderenvironmentVariable(java.lang.String key, java.lang.String value)Add an environment variableSystemCommandExecuterBuildershell(java.lang.String... shell)Set the shellprotected java.lang.StringtoString(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 stringSystemCommandExecuterBuilderuser(java.lang.String user)Set the userSystemCommandExecuterBuilderworkingPath(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
-
-