net.praqma.util.execute
Class CommandLine

java.lang.Object
  extended by net.praqma.util.execute.CommandLine
All Implemented Interfaces:
CommandLineInterface

public class CommandLine
extends Object
implements CommandLineInterface

CLI class

Author:
wolfgang

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.praqma.util.execute.CommandLineInterface
CommandLineInterface.OperatingSystem
 
Field Summary
protected static String linesep
           
protected  PraqmaLogger.Logger logger
           
 
Method Summary
static CommandLine getInstance()
           
 CommandLineInterface.OperatingSystem getOS()
           
 CmdResult run(String cmd)
           
 CmdResult run(String cmd, File dir)
           
 CmdResult run(String cmd, File dir, boolean merge)
           
 CmdResult run(String cmd, File dir, boolean merge, boolean ignore)
          Execute a command line operation.
 void setLogger(PraqmaLogger.Logger logger)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected PraqmaLogger.Logger logger

linesep

protected static final String linesep
Method Detail

setLogger

public void setLogger(PraqmaLogger.Logger logger)
Specified by:
setLogger in interface CommandLineInterface

getOS

public CommandLineInterface.OperatingSystem getOS()
Specified by:
getOS in interface CommandLineInterface

getInstance

public static CommandLine getInstance()

run

public CmdResult run(String cmd)
              throws CommandLineException,
                     AbnormalProcessTerminationException
Specified by:
run in interface CommandLineInterface
Throws:
CommandLineException
AbnormalProcessTerminationException

run

public CmdResult run(String cmd,
                     File dir)
              throws CommandLineException,
                     AbnormalProcessTerminationException
Specified by:
run in interface CommandLineInterface
Throws:
CommandLineException
AbnormalProcessTerminationException

run

public CmdResult run(String cmd,
                     File dir,
                     boolean merge)
              throws CommandLineException,
                     AbnormalProcessTerminationException
Specified by:
run in interface CommandLineInterface
Throws:
CommandLineException
AbnormalProcessTerminationException

run

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

Specified by:
run in interface CommandLineInterface
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.