org.mmbase.util
Class Execute

java.lang.Object
  |
  +--org.mmbase.util.Execute

public class Execute
extends java.lang.Object

Class for running programs and executing commands. The methods in this class catch and return output from these commands (both info and error messages).

Version:
9 Apr 2001
Author:
Daniel Ockeloen, Pierre van Rooden (javadocs)

Constructor Summary
Execute()
           
 
Method Summary
 java.lang.String execute(java.lang.String command)
          Executes a command or program.
 java.lang.String execute(java.lang.String[] command)
          Executes a command or program.
static void main(java.lang.String[] args)
          Deprecated. Only for testing. I mean, why bother?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Execute

public Execute()
Method Detail

execute

public java.lang.String execute(java.lang.String[] command)
Executes a command or program. The output of the program is returned as a string.
Parameters:
command - An array of strings, in which teh first argument is the command to execute, and the rest its parameters
Returns:
the command output

execute

public java.lang.String execute(java.lang.String command)
Executes a command or program. The output of the program is returned as a string.
Parameters:
command - the command to execute
Returns:
the command output

main

public static void main(java.lang.String[] args)
Deprecated. Only for testing. I mean, why bother?

Entry for direct invocation from the commandline. Usage:
java Execute [command]
Does not take parameters.


MMBase 2002