Proc.LocalProc, Proc.ProcWithJenkins23271Patch, Proc.RemoteProc
Modifier and Type | Field and Description |
---|---|
static InputStream |
SELFPUMP_INPUT |
static OutputStream |
SELFPUMP_OUTPUT |
Constructor and Description |
---|
LocalProc(String[] cmd,
Map<String,String> env,
InputStream in,
OutputStream out) |
LocalProc(String[] cmd,
String[] env,
InputStream in,
OutputStream out) |
LocalProc(String[] cmd,
String[] env,
InputStream in,
OutputStream out,
File workDir) |
LocalProc(String[] cmd,
String[] env,
InputStream in,
OutputStream out,
OutputStream err,
File workDir) |
LocalProc(String[] cmd,
String[] env,
OutputStream out,
File workDir) |
LocalProc(String cmd,
Map<String,String> env,
OutputStream out,
File workDir) |
LocalProc(String cmd,
String[] env,
OutputStream out,
File workDir) |
Modifier and Type | Method and Description |
---|---|
InputStream |
getStderr()
Returns an
InputStream to read from stderr of the child process. |
OutputStream |
getStdin()
Returns an
OutputStream to write to stdin of the child process. |
InputStream |
getStdout()
Returns an
InputStream to read from stdout of the child process. |
boolean |
isAlive()
Checks if the process is still alive.
|
int |
join()
Waits for the completion of the process.
|
void |
kill()
Terminates the process.
|
joinWithTimeout
public static final InputStream SELFPUMP_INPUT
public static final OutputStream SELFPUMP_OUTPUT
public LocalProc(String cmd, Map<String,String> env, OutputStream out, File workDir) throws IOException
IOException
public LocalProc(String[] cmd, Map<String,String> env, InputStream in, OutputStream out) throws IOException
IOException
public LocalProc(String cmd, String[] env, OutputStream out, File workDir) throws IOException
IOException
public LocalProc(String[] cmd, String[] env, OutputStream out, File workDir) throws IOException
IOException
public LocalProc(String[] cmd, String[] env, InputStream in, OutputStream out) throws IOException
IOException
public LocalProc(String[] cmd, String[] env, InputStream in, OutputStream out, File workDir) throws IOException
IOException
public LocalProc(String[] cmd, String[] env, InputStream in, OutputStream out, OutputStream err, File workDir) throws IOException
err
- null to redirect stderr to stdout.IOException
public InputStream getStdout()
Proc
InputStream
to read from stdout
of the child process.
When this method returns null, Proc
will internally pump the output from
the child process to your OutputStream
of choosing.
getStdout
in class Proc
null
unless Launcher.ProcStarter.readStdout()
is used to indicate
that the caller intends to pump the stream by itself.public InputStream getStderr()
Proc
InputStream
to read from stderr
of the child process.
When this method returns null, Proc
will internally pump the output from
the child process to your OutputStream
of choosing.
getStderr
in class Proc
null
unless Launcher.ProcStarter.readStderr()
is used to indicate
that the caller intends to pump the stream by itself.public OutputStream getStdin()
Proc
OutputStream
to write to stdin
of the child process.
When this method returns null, Proc
will internally pump the InputStream
of your choosing to the child process.
getStdin
in class Proc
null
unless Launcher.ProcStarter.writeStdin()
is used to indicate
that the caller intends to pump the stream by itself.public int join() throws InterruptedException, IOException
join
in class Proc
IOException
- if there's an error launching/joining a process
and a stack trace could help the trouble-shooting.InterruptedException
public boolean isAlive() throws IOException, InterruptedException
Proc
isAlive
in class Proc
IOException
InterruptedException
public void kill() throws InterruptedException, IOException
Proc
kill
in class Proc
IOException
- if there's an error killing a process
and a stack trace could help the trouble-shooting.InterruptedException
Copyright © 2004–2021. All rights reserved.