Package com.prineside.luaj.lib.jse
Class JseProcess
java.lang.Object
com.prineside.luaj.lib.jse.JseProcess
Analog of Process that pipes input and output to client-specified streams.
-
Constructor Summary
ConstructorsConstructorDescriptionJseProcess
(String[] cmd, InputStream stdin, OutputStream stdout, OutputStream stderr) Construct a process around a command, with specified streams to redirect input and output to.JseProcess
(String cmd, InputStream stdin, OutputStream stdout, OutputStream stderr) Construct a process around a command, with specified streams to redirect input and output to. -
Method Summary
-
Constructor Details
-
JseProcess
public JseProcess(String[] cmd, InputStream stdin, OutputStream stdout, OutputStream stderr) throws IOException Construct a process around a command, with specified streams to redirect input and output to.- Parameters:
cmd
- The command to execute, including arguments, if anystdin
- Optional InputStream to read from as process input, or null if input is not needed.stdout
- Optional OutputStream to copy process output to, or null if output is ignored.stderr
- Optinoal OutputStream to copy process stderr output to, or null if output is ignored.- Throws:
IOException
- If the system process could not be created.- See Also:
-
JseProcess
public JseProcess(String cmd, InputStream stdin, OutputStream stdout, OutputStream stderr) throws IOException Construct a process around a command, with specified streams to redirect input and output to.- Parameters:
cmd
- The command to execute, including arguments, if anystdin
- Optional InputStream to read from as process input, or null if input is not needed.stdout
- Optional OutputStream to copy process output to, or null if output is ignored.stderr
- Optinoal OutputStream to copy process stderr output to, or null if output is ignored.- Throws:
IOException
- If the system process could not be created.- See Also:
-
-
Method Details
-
exitValue
public int exitValue()Get the exit value of the process. -
waitFor
Wait for the process to complete, and all pending output to finish.- Returns:
- The exit status.
- Throws:
InterruptedException
-