Class JseProcess

java.lang.Object
com.prineside.luaj.lib.jse.JseProcess

public class JseProcess extends Object
Analog of Process that pipes input and output to client-specified streams.
  • 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 any
      stdin - 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 any
      stdin - 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

      public int waitFor() throws InterruptedException
      Wait for the process to complete, and all pending output to finish.
      Returns:
      The exit status.
      Throws:
      InterruptedException