public class CommandExecutor
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
CommandExecutor(java.lang.String executablePath,
java.util.Map<java.lang.String,java.lang.String> env) |
| Modifier and Type | Method and Description |
|---|---|
CommandResults |
exeCommand(java.io.File execDir,
java.util.List<java.lang.String> args,
java.util.List<java.lang.String> credentials,
org.jfrog.build.api.util.Log logger)
Execute a command in external process.
|
CommandResults |
exeCommand(java.io.File execDir,
java.util.List<java.lang.String> args,
java.util.List<java.lang.String> credentials,
org.jfrog.build.api.util.Log logger,
long timeout,
java.util.concurrent.TimeUnit unit)
Execute a command in external process.
|
public CommandExecutor(java.lang.String executablePath,
java.util.Map<java.lang.String,java.lang.String> env)
executablePath - - Executable path.env - - Environment variables to use during execution.public CommandResults exeCommand(java.io.File execDir, java.util.List<java.lang.String> args, java.util.List<java.lang.String> credentials, org.jfrog.build.api.util.Log logger) throws java.lang.InterruptedException, java.io.IOException
execDir - - The execution dir (Usually path to project). Null means current directory.args - - Command arguments.credentials - - If specified, the credentials will be concatenated to the other commands. The credentials will be masked in the log output.logger - - The logger which will log the running command.java.lang.InterruptedExceptionjava.io.IOExceptionpublic CommandResults exeCommand(java.io.File execDir, java.util.List<java.lang.String> args, java.util.List<java.lang.String> credentials, org.jfrog.build.api.util.Log logger, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.io.IOException
execDir - - The execution dir (Usually path to project). Null means current directory.args - - Command arguments.credentials - - If specified, the credentials will be concatenated to the other commands. The credentials will be masked in the log output.logger - - The logger which will log the running command.timeout - - The maximum time to wait for the command execution.unit - - The time unit of the timeout argument.java.lang.InterruptedExceptionjava.io.IOException