public class CommandLine extends Object implements CommandLineInterface
CommandLineInterface.OperatingSystem| Modifier and Type | Field and Description |
|---|---|
protected static String |
linesep |
protected static Logger |
logger |
| Modifier and Type | Method and Description |
|---|---|
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) |
CmdResult |
run(String c,
File dir,
boolean merge,
boolean ignore,
Map<String,String> variables)
Execute a command line operation.
|
protected static final Logger logger
protected static final String linesep
public CommandLineInterface.OperatingSystem getOS()
getOS in interface CommandLineInterfacepublic static CommandLine getInstance()
public CmdResult run(String cmd) throws CommandLineException, AbnormalProcessTerminationException
run in interface CommandLineInterfaceCommandLineExceptionAbnormalProcessTerminationExceptionpublic CmdResult run(String cmd, File dir) throws CommandLineException, AbnormalProcessTerminationException
run in interface CommandLineInterfaceCommandLineExceptionAbnormalProcessTerminationExceptionpublic CmdResult run(String cmd, File dir, boolean merge) throws CommandLineException, AbnormalProcessTerminationException
run in interface CommandLineInterfaceCommandLineExceptionAbnormalProcessTerminationExceptionpublic CmdResult run(String cmd, File dir, boolean merge, boolean ignore) throws CommandLineException, AbnormalProcessTerminationException
run in interface CommandLineInterfaceCommandLineExceptionAbnormalProcessTerminationExceptionpublic CmdResult run(String c, File dir, boolean merge, boolean ignore, Map<String,String> variables) throws CommandLineException, AbnormalProcessTerminationException
run in interface CommandLineInterfacec - The command itselfdir - The working directorymerge - Merge stderror with stdoutignore - Ignore any abnormal process terminations. This will allow the
output to be returned without exceptions to be thrown.CommandLineExceptionAbnormalProcessTerminationExceptionCopyright © 2018. All rights reserved.