Class Launcher

java.lang.Object
com.ibm.wala.util.processes.Launcher
Direct Known Subclasses:
BasicLauncher, JavaLauncher

public abstract class Launcher extends Object
Abstract base class for a process launcher
  • Field Details

    • workingDir

      protected @Nullable File workingDir
    • env

      protected @Nullable Map<String,String> env
    • stdOut

      protected byte @Nullable [] stdOut
    • stdErr

      protected byte @Nullable [] stdErr
  • Constructor Details

    • Launcher

      protected Launcher(Logger logger)
    • Launcher

      protected Launcher(boolean captureOutput, boolean captureErr, Logger logger)
  • Method Details

    • getWorkingDir

      public @Nullable File getWorkingDir()
    • setWorkingDir

      public void setWorkingDir(File newWorkingDir)
    • getEnv

      public @Nullable Map<String,String> getEnv()
    • setEnv

      public void setEnv(Map<String,String> newEnv)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • spawnProcess

      protected Process spawnProcess(@Nullable String cmd) throws IllegalArgumentException, IOException
      Spawn a process to execute the given command
      Returns:
      an object representing the process
      Throws:
      IllegalArgumentException
      IOException
    • spawnProcess

      protected Process spawnProcess(String[] cmd) throws IllegalArgumentException, IOException
      Spawn a process to execute the given command
      Returns:
      an object representing the process
      Throws:
      IllegalArgumentException
      IOException
    • drainStdOut

      protected Thread drainStdOut(Process p)
    • captureStdOut

      protected Launcher.Drainer captureStdOut(Process p)
    • drainStdErr

      protected Thread drainStdErr(Process p)
    • captureStdErr

      protected Launcher.Drainer captureStdErr(Process p)
    • isCaptureOutput

      public boolean isCaptureOutput()
    • isCaptureErr

      public boolean isCaptureErr()
    • getStdOut

      @NullUnmarked public @org.jspecify.annotations.Nullable byte[] getStdOut()
    • getStderr

      @NullUnmarked public @org.jspecify.annotations.Nullable byte[] getStderr()
    • setStdOut

      protected void setStdOut(byte[] newOutput)
    • setStdErr

      protected void setStdErr(byte[] newErr)
    • getInput

      @NullUnmarked public @org.jspecify.annotations.Nullable byte[] getInput()
    • setInput

      public void setInput(byte[] input)
      Set input which will be fed to the launched process's stdin