org.objectweb.common
Class Cmd

java.lang.Object
  extended byorg.objectweb.common.Cmd

public class Cmd
extends java.lang.Object


Constructor Summary
Cmd(java.lang.String cmd)
          Construtor method of Cmd class.
Cmd(java.lang.String cmd, boolean invoke)
          Construtor method of Cmd class.
Cmd(java.lang.String cmd, java.lang.String[] env, boolean invoke)
          Construtor method of Cmd class.
 
Method Summary
 void addArgument(java.lang.String arg)
          Add a new argument to the command.
 void addArguments(java.util.Vector args)
          Add a new argument to the command.
 boolean run()
          Execute the command.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cmd

public Cmd(java.lang.String cmd,
           boolean invoke)
Construtor method of Cmd class.

Parameters:
cmd - command
invoke - try to invoke directly the method of the java class of the command

Cmd

public Cmd(java.lang.String cmd)
Construtor method of Cmd class. Equivalent to Cmd(cmd, false).

Parameters:
cmd - command

Cmd

public Cmd(java.lang.String cmd,
           java.lang.String[] env,
           boolean invoke)
Construtor method of Cmd class.

Parameters:
cmd - command
env - environment of the command
Method Detail

addArgument

public void addArgument(java.lang.String arg)
Add a new argument to the command.

Parameters:
arg - argument added to the tail of the command argument list

addArguments

public void addArguments(java.util.Vector args)
Add a new argument to the command.


run

public boolean run()
Execute the command. (In case of the exit value of the command is not 0, the output and error streams of the command is traced.)

Returns:
false if the command cannot be executed, or if its exit value is not 0.

toString

public java.lang.String toString()