Package wt.util

Class ProcessLauncher

java.lang.Object
wt.util.ProcessLauncher

public class ProcessLauncher extends Object
Performs the process using another thread to start sending output, before processing has completed.

Supported API: true

Extendable: false
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    Launch the subprocess and wait for it to complete.
    void
    The errors from the process and local class methods will be written to this PrintStream, for reading to begin before processing completes.
    void
    The errors from the process and local class methods will be written to this PrintWriter, for reading to begin after the process completes.
    void
    The output from the process's output stream will be written to this PrintStream, for reading to begin before processing completes.
    void
    The output from the process's output stream will be written to this PrintWriter, for reading to begin after the process completes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProcessLauncher

      @Deprecated public ProcessLauncher(String command)
      Deprecated.
      Create an instance to run the command. Escapes windows commands as documented here: http://bugs.sun.com/view_bug.do?bug_id=6511002

      Supported API: true
      Parameters:
      command - Process this command.
  • Method Details

    • setErrorWriter

      public void setErrorWriter(PrintWriter error_writer)
      The errors from the process and local class methods will be written to this PrintWriter, for reading to begin after the process completes. Will only take effect if invoked prior to runProcess().

      Supported API: true
      Parameters:
      error_writer - After processing completes, review errors from here.
    • setOutWriter

      public void setOutWriter(PrintWriter out_writer)
      The output from the process's output stream will be written to this PrintWriter, for reading to begin after the process completes. Will only take effect if invoked prior to runProcess().

      Supported API: true
      Parameters:
      out_writer - After processing completes, review the process' progression from here.
    • setErrorStream

      public void setErrorStream(PrintStream error_stream)
      The errors from the process and local class methods will be written to this PrintStream, for reading to begin before processing completes. Will only take effect if invoked prior to runProcess().

      Supported API: true
      Parameters:
      error_stream - While still processing, look at errors from here.
    • setOutStream

      public void setOutStream(PrintStream out_stream)
      The output from the process's output stream will be written to this PrintStream, for reading to begin before processing completes. Will only take effect if invoked prior to runProcess().

      Supported API: true
      Parameters:
      out_stream - While still processing, look at the process' progression from here.
    • runProcess

      public final int runProcess() throws IOException
      Launch the subprocess and wait for it to complete.

      Supported API: true
      Returns:
      the return code of the subprocess
      Throws:
      IOException - Forwarded from runProcess(long,long).