Package com.ibm.wala.util.processes
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classLauncher.DrainerA thread that runs in a loop, performing the drain() action until a process terminates
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Launcher.DrainercaptureStdErr(Process p)protected Launcher.DrainercaptureStdOut(Process p)protected ThreaddrainStdErr(Process p)protected ThreaddrainStdOut(Process p)@Nullable Map<String,String>getEnv()@org.jspecify.annotations.Nullable byte[]getInput()@org.jspecify.annotations.Nullable byte[]getStderr()@org.jspecify.annotations.Nullable byte[]getStdOut()@Nullable FilegetWorkingDir()booleanisCaptureErr()booleanisCaptureOutput()voidsetEnv(Map<String,String> newEnv)voidsetInput(byte[] input)Set input which will be fed to the launched process's stdinprotected voidsetStdErr(byte[] newErr)protected voidsetStdOut(byte[] newOutput)voidsetWorkingDir(File newWorkingDir)protected ProcessspawnProcess(@Nullable String cmd)Spawn a process to execute the given commandprotected ProcessspawnProcess(String[] cmd)Spawn a process to execute the given commandStringtoString()
-
-
-
Method Detail
-
getWorkingDir
public @Nullable File getWorkingDir()
-
setWorkingDir
public void setWorkingDir(File newWorkingDir)
-
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:
IllegalArgumentExceptionIOException
-
spawnProcess
protected Process spawnProcess(String[] cmd) throws IllegalArgumentException, IOException
Spawn a process to execute the given command- Returns:
- an object representing the process
- Throws:
IllegalArgumentExceptionIOException
-
captureStdOut
protected Launcher.Drainer captureStdOut(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
-
-