exec
.
TODO Assure JVM closes properly after process execution (dispose process resources, etc.)
TODO Add use case and example in documentation.
Run the receiver's text as a process in the host operating system. The command can have multiple lines and may or may not contain the shell continuation string (\\n
).
Multiple words parameters can not be used, for that requirement you can use the shell method, or run exec using a list of items (program and parameters).
Receiver
String holding the command to be executed.
Return
The output of the command.
Parameters
Directory on which the process will be executed. Defaults to current directory.
Maximum number of seconds allowed for process execution. Defaults to the maximum long value. It must be greater than zero.
If true Raise an exception if the result code is different from zero. The default value is false
.
Throws
Thrown if the process return an error code (the actual code is passed inside CodedException.code and the command output is set at CodedException.message).
If the command doesn't end within the allowed time or the command string is blank, an exception will be thrown.