Object
XExec
Additions to standard java.lang.ProcessBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
start()
Run the command with given input if anywithDirectory
(String workingDirectory) Sets the working directory for the processwithDirectory
(Path workingDirectory) Sets the working directory for the processwithEnvironmentVariables
(Map<String, String> vars) Adds following variables into environmentGiven input will be sent to command's stdin.withMaskedSecrets
(String... secrets) List of secrets which will be masked in the command output (both stdout, stderr)
-
Constructor Details
-
XExec
Constructor which accepts the command to run. First item of the array should be the command itself and the rest items are arguments of it. -
XExec
Constructor which accepts the command to run. First item of the list should be the command itself and the rest items are arguments of it. -
XExec
Constructor which accepts the full command line to run.It supports quotes so command like "ls \"/tmp/Program Files\"" will be processed like "ls" "/tmp/Program Files" instead of "ls" "/tmp/Program" "Files"
-
-
Method Details
-
withInput
Given input will be sent to command's stdin. -
withDirectory
Sets the working directory for the process -
withDirectory
Sets the working directory for the process -
withEnvironmentVariables
Adds following variables into environment -
withMaskedSecrets
List of secrets which will be masked in the command output (both stdout, stderr) -
getCommand
-
getProcessBuilder
-
start
Run the command with given input if any
-