public class Exec extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Exec.ExecException
Thrown if a call to an external program fails
|
Modifier and Type | Field and Description |
---|---|
static Log |
LOG
Can be used to log errors and infos when executing external programs.
|
Modifier and Type | Method and Description |
---|---|
static String |
exec(String command)
Executes the given command and returns a transcript of stderr and stdout
|
static String |
exec(String command,
boolean ignoreExitCodes)
Executes the given command and returns a transcript of stderr and stdout.
|
public static final Log LOG
public static String exec(String command) throws Exec.ExecException
command
- the command to executeExec.ExecException
- in case the external program fails or returns an exit code other than 0.public static String exec(String command, boolean ignoreExitCodes) throws Exec.ExecException
command
- the command to executeignoreExitCodes
- if an exit code other than 0 should result in an exception being thrownExec.ExecException
- in case the external program failsCopyright © 2018. All rights reserved.