|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.util.ShellCommand
public class ShellCommand
Passes a command to the OS shell for execution and manages the input and output.
This class must be kept gcj
-compatible.
Constructor Summary | |
---|---|
ShellCommand()
|
Method Summary | |
---|---|
void |
execute(java.lang.String shellCommand)
Passes a command to the shell for execution and returns immediately without waiting for an exit status. |
boolean |
executeAndWait(java.lang.String shellCommand)
Passes a command to the shell for execution. |
boolean |
executeAndWaitTimed(java.lang.String shellCommand,
int seconds)
Passes a command to the shell for execution. |
void |
executeSilent(java.lang.String shellCommand)
Passes a command to the shell for execution and returns immediately without waiting for an exit status. |
boolean |
executeSilentAndWait(java.lang.String shellCommand)
Passes a command to the shell for execution. |
boolean |
executeSilentAndWaitTimed(java.lang.String shellCommand,
int seconds)
Passes a command to the shell for execution. |
java.io.InputStream |
getErrorStream()
|
java.io.InputStream |
getInputStream()
|
java.io.OutputStream |
getOutputStream()
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShellCommand()
Method Detail |
---|
public void execute(java.lang.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()
.
shellCommand
- The command for the shell to execute.public boolean executeAndWait(java.lang.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()
.
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 executeAndWaitTimed(java.lang.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()
.
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
.public void executeSilent(java.lang.String shellCommand) throws java.io.IOException
shellCommand
- The command for the shell to execute.
java.io.IOException
public boolean executeSilentAndWait(java.lang.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(java.lang.String shellCommand, int seconds)
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
.public java.io.InputStream getErrorStream()
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |