Package hudson
Class Proc.LocalProc
java.lang.Object
hudson.Proc
hudson.Proc.LocalProc
- Enclosing class:
- Proc
Locally launched process.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.Proc
Proc.LocalProc, Proc.ProcWithJenkins23271Patch, Proc.RemoteProc
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLocalProc
(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, InputStream in, OutputStream out) LocalProc
(String cmd, String[] env, OutputStream out, File workDir) -
Method Summary
Modifier and TypeMethodDescriptionReturns anInputStream
to read fromstderr
of the child process.getStdin()
Returns anOutputStream
to write tostdin
of the child process.Returns anInputStream
to read fromstdout
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.Methods inherited from class hudson.Proc
joinWithTimeout
-
Field Details
-
SELFPUMP_INPUT
-
SELFPUMP_OUTPUT
-
-
Constructor Details
-
LocalProc
public LocalProc(String cmd, Map<String, String> env, OutputStream out, File workDir) throws IOException- Throws:
IOException
-
LocalProc
public LocalProc(String[] cmd, Map<String, String> env, InputStream in, OutputStream out) throws IOException- Throws:
IOException
-
LocalProc
- Throws:
IOException
-
LocalProc
- Throws:
IOException
-
LocalProc
- Throws:
IOException
-
LocalProc
public LocalProc(String[] cmd, String[] env, InputStream in, OutputStream out, File workDir) throws IOException - Throws:
IOException
-
LocalProc
public LocalProc(String[] cmd, String[] env, InputStream in, OutputStream out, OutputStream err, File workDir) throws IOException - Parameters:
err
- null to redirect stderr to stdout.- Throws:
IOException
-
-
Method Details
-
getStdout
Description copied from class:Proc
Returns anInputStream
to read fromstdout
of the child process.When this method returns null,
Proc
will internally pump the output from the child process to yourOutputStream
of choosing.- Specified by:
getStdout
in classProc
- Returns:
null
unlessLauncher.ProcStarter.readStdout()
is used to indicate that the caller intends to pump the stream by itself.
-
getStderr
Description copied from class:Proc
Returns anInputStream
to read fromstderr
of the child process.When this method returns null,
Proc
will internally pump the output from the child process to yourOutputStream
of choosing.- Specified by:
getStderr
in classProc
- Returns:
null
unlessLauncher.ProcStarter.readStderr()
is used to indicate that the caller intends to pump the stream by itself.
-
getStdin
Description copied from class:Proc
Returns anOutputStream
to write tostdin
of the child process.When this method returns null,
Proc
will internally pump theInputStream
of your choosing to the child process.- Specified by:
getStdin
in classProc
- Returns:
null
unlessLauncher.ProcStarter.writeStdin()
is used to indicate that the caller intends to pump the stream by itself.
-
join
Waits for the completion of the process.- Specified by:
join
in classProc
- Throws:
IOException
- if there's an error launching/joining a process and a stack trace could help the trouble-shooting.InterruptedException
-
isAlive
Description copied from class:Proc
Checks if the process is still alive.- Specified by:
isAlive
in classProc
- Throws:
IOException
InterruptedException
-
kill
Description copied from class:Proc
Terminates the process.- Specified by:
kill
in classProc
- Throws:
IOException
- if there's an error killing a process and a stack trace could help the trouble-shooting.InterruptedException
-