public class CommandExecutor extends Object
Constructor and Description |
---|
CommandExecutor() |
Modifier and Type | Method and Description |
---|---|
int |
exec(String command)
Handy method for
exec(String, File, OutputStream, boolean) running
in working folder of JVM with no dump output stream. |
int |
exec(String command,
File folder)
Handy method for
exec(String, File, OutputStream, boolean) with no
dump output stream. |
int |
exec(String command,
File folder,
OutputStream dumpOutputStream)
Handy method for
exec(String, File, OutputStream, boolean) with
specified dump output stream (but no closing). |
int |
exec(String command,
File folder,
OutputStream dumpOutputStream,
boolean closeDumpOutputStream)
Executes the specified command.
|
int |
exec(String command,
OutputStream dumpOutputStream)
Handy method for
exec(String, File, OutputStream, boolean) running
in working folder of JVM with specified dump output stream (but no
closing). |
public final int exec(String command) throws IOException, InterruptedException
exec(String, File, OutputStream, boolean)
running
in working folder of JVM with no dump output stream.command
- the command to be executed0
indicates normal termination)IOException
- if an I/O error occursInterruptedException
- if the current thread is interrupted by another thread while it is waitingpublic final int exec(String command, File folder) throws IOException, InterruptedException
exec(String, File, OutputStream, boolean)
with no
dump output stream.command
- the command to be executedfolder
- the working folder0
indicates normal termination)IOException
- if an I/O error occursInterruptedException
- if the current thread is interrupted by another thread while it is waitingpublic final int exec(String command, OutputStream dumpOutputStream) throws IOException, InterruptedException
exec(String, File, OutputStream, boolean)
running
in working folder of JVM with specified dump output stream (but no
closing).command
- the command to be executeddumpOutputStream
- the stream where the process will dump (exhaust) his contents0
indicates normal termination)IOException
- if an I/O error occursInterruptedException
- if the current thread is interrupted by another thread while it is waitingpublic final int exec(String command, File folder, OutputStream dumpOutputStream) throws IOException, InterruptedException
exec(String, File, OutputStream, boolean)
with
specified dump output stream (but no closing).command
- the command to be executedfolder
- the working folderdumpOutputStream
- the stream where the process will dump (exhaust) his contents0
indicates normal termination)IOException
- if an I/O error occursInterruptedException
- if the current thread is interrupted by another thread while it is waitingpublic final int exec(String command, File folder, OutputStream dumpOutputStream, boolean closeDumpOutputStream) throws IOException, InterruptedException
command
- the command to be executedfolder
- the working folderdumpOutputStream
- the stream where the process will dump (exhaust) his contentscloseDumpOutputStream
- true
if the dump stream should be closed when the
execution ends, false
otherwise0
indicates normal termination)IOException
- if an I/O error occursInterruptedException
- if the current thread is interrupted by another thread while it is waitingCopyright © 2013–2014 Cristian Sulea. All rights reserved.