public class ShellCommand extends Object
This class must be kept gcj-compatible.
| Constructor | Description |
|---|---|
ShellCommand() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
execute(String shellCommand) |
Deprecated.
unused
|
boolean |
executeAndWait(String shellCommand) |
Deprecated.
unused
|
boolean |
executeAndWaitTimed(String shellCommand,
int seconds) |
Deprecated.
unused
|
void |
executeSilent(String shellCommand) |
Deprecated.
unused
|
boolean |
executeSilentAndWait(String shellCommand) |
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.
|
InputStream |
getErrorStream() |
Deprecated.
unused
|
InputStream |
getInputStream() |
Deprecated.
unused
|
OutputStream |
getOutputStream() |
Deprecated.
unused
|
static void |
main(String[] args) |
Just does exec, this is NOT a test of ShellCommand.
|
@Deprecated public void execute(String shellCommand)
STDOUT and STDERR
as appropriate, and can be read via getOutputStream() and
getErrorStream(), respectively. Input can be passed to the
STDIN of the shell process via getInputStream().
Warning, no good way to quote or escape spaces in arguments with this method.shellCommand - The command for the shell to execute.@Deprecated public boolean executeAndWait(String shellCommand)
STDOUT and
STDERR as appropriate, and can be read via
getOutputStream() and getErrorStream(), respectively.
Input can be passed to the STDIN of the shell process via
getInputStream().
Warning, no good way to quote or escape spaces in arguments with this method.shellCommand - The command for the shell to execute.true if the spawned shell process
returns an exit status of 0 (indicating success),
else false.@Deprecated public boolean executeAndWaitTimed(String shellCommand, int seconds)
STDOUT and STDERR
as appropriate, and can be read via getOutputStream() and
getErrorStream(), respectively. Input can be passed to the
STDIN of the shell process via getInputStream().
Warning, no good way to quote or escape spaces in arguments with this method.shellCommand - The command for the shell to execute.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),
else false.@Deprecated public void executeSilent(String shellCommand) throws IOException
shellCommand - The command for the shell to execute.IOExceptionpublic boolean executeSilentAndWait(String shellCommand)
shellCommand - The command for the shell to execute.true if the spawned shell process
returns an exit status of 0 (indicating success),
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 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.@Deprecated public InputStream getErrorStream()
@Deprecated public InputStream getInputStream()
@Deprecated public OutputStream getOutputStream()
public static void main(String[] args)