public class ShellCommand extends Object
| Constructor and Description |
|---|
ShellCommand() |
| Modifier and Type | Method and Description |
|---|---|
boolean | executeSilentAndWait(String[] commandArray)Passes a command to the shell for execution. |
boolean | executeSilentAndWaitTimed(String[] commandArray,
int seconds)Passes a command to the shell for execution. |
boolean | executeSilentAndWaitTimed(String shellCommand,
int seconds)Passes a command to the shell for execution. |
static void | main(String[] args)Just does exec, this is NOT a test of ShellCommand. |
public boolean executeSilentAndWait(String[] commandArray)
commandArray - The command for the shell to execute,
as a String[].
See Runtime.exec(String[]) for more info.true if the spawned shell process
returns an exit status of 0 (indicating success),
else false.public boolean executeSilentAndWaitTimed(String[] commandArray, int seconds)
commandArray - The command for the shell to execute,
as a String[].
See Runtime.exec(String[]) for more info.seconds - The method will return true if this
number of seconds elapses without the process
returning an exit status. A value of 0
here disables waiting.true if the spawned shell process
returns an exit status of 0 (indicating success),
OR if the time expires,
else false.public boolean executeSilentAndWaitTimed(String shellCommand, int seconds)
shellCommand - The command for the shell to execute, as a String.
You can't quote arguments successfully.
See Runtime.exec(String) for more info.seconds - The method will return true if this
number of seconds elapses without the process
returning an exit status. A value of 0
here disables waiting.true if the spawned shell process
returns an exit status of 0 (indicating success),
OR if the time expires,
else false.public static void main(String[] args)