net.praqma.util.execute
Class Command

java.lang.Object
  extended by net.praqma.util.execute.Command

public abstract class Command
extends Object

CLI class

Author:
wolfgang

Field Summary
protected static String linesep
           
protected static PraqmaLogger.Logger logger
           
 
Constructor Summary
Command()
           
 
Method Summary
static CmdResult run(String cmd)
           
static CmdResult run(String cmd, File dir)
           
static CmdResult run(String cmd, File dir, boolean merge)
           
static CmdResult run(String cmd, File dir, boolean merge, boolean ignore)
          Execute a command line operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static PraqmaLogger.Logger logger

linesep

protected static final String linesep
Constructor Detail

Command

public Command()
Method Detail

run

public static CmdResult run(String cmd)
                     throws CommandLineException,
                            AbnormalProcessTerminationException
Throws:
CommandLineException
AbnormalProcessTerminationException

run

public static CmdResult run(String cmd,
                            File dir)
                     throws CommandLineException,
                            AbnormalProcessTerminationException
Throws:
CommandLineException
AbnormalProcessTerminationException

run

public static CmdResult run(String cmd,
                            File dir,
                            boolean merge)
                     throws CommandLineException,
                            AbnormalProcessTerminationException
Throws:
CommandLineException
AbnormalProcessTerminationException

run

public static CmdResult run(String cmd,
                            File dir,
                            boolean merge,
                            boolean ignore)
                     throws CommandLineException,
                            AbnormalProcessTerminationException
Execute a command line operation.

Parameters:
cmd - The command itself
dir - The working directory
merge - Merge stderror with stdout
ignore - Ignore any abnormal process terminations. This will allow the output to be returned without exceptions to be thrown.
Returns:
Throws:
CommandLineException
AbnormalProcessTerminationException


Copyright © 2011. All Rights Reserved.