public final class ProcessHelper extends Object
| Constructor and Description |
|---|
ProcessHelper() |
| Modifier and Type | Method and Description |
|---|---|
static int |
execute(String command)
Executes the external process using the provided command.
|
static int |
execute(String command,
String[] arguments)
Executes the external process using the provided command, arguments (optional).
|
static int |
execute(String command,
String[] arguments,
Map<String,Object> parameterSubstitutionMap)
Executes the external process using the provided command, arguments (optional), parameter substitution map to expand variables in the
command or arguments in form of
${variable} |
static int |
execute(String command,
String[] arguments,
Map<String,Object> parameterSubstitutionMap,
File workingDir,
StringBuilder resultOut,
StringBuilder resultErr)
Executes the external process using the provided command, arguments (optional), parameter substitution map to expand variables in the
command or arguments in form of
${variable} |
static int |
execute(String command,
String[] arguments,
Map<String,Object> parameterSubstitutionMap,
File workingDir,
StringBuilder resultOut,
StringBuilder resultErr,
boolean redirectOutputs)
Executes the external process using the provided command, arguments (optional), parameter substitution map to expand variables in the
command or arguments in form of
${variable} |
public static int execute(String command) throws JahiaRuntimeException
command - the command to be executedJahiaRuntimeException - in case the process execution failedpublic static int execute(String command, String[] arguments) throws JahiaRuntimeException
command - the command to be executedarguments - optional arguments for the commandJahiaRuntimeException - in case the process execution failedpublic static int execute(String command, String[] arguments, Map<String,Object> parameterSubstitutionMap) throws JahiaRuntimeException
${variable} (optional).command - the command to be executedarguments - optional arguments for the commandparameterSubstitutionMap - optional values for variables to be expandedJahiaRuntimeException - in case the process execution failedpublic static int execute(String command, String[] arguments, Map<String,Object> parameterSubstitutionMap, File workingDir, StringBuilder resultOut, StringBuilder resultErr) throws JahiaRuntimeException
${variable} (optional) and a working directory (optional).
Buffers for process output and error stream can be provided.command - the command to be executedarguments - optional arguments for the commandparameterSubstitutionMap - optional values for variables to be expandedworkingDir - optional working directory for the process to be started fromresultOut - the buffer to write the process execution output into (optional)resultErr - the buffer to write the process execution error into (optional)JahiaRuntimeException - in case the process execution failedpublic static int execute(String command, String[] arguments, Map<String,Object> parameterSubstitutionMap, File workingDir, StringBuilder resultOut, StringBuilder resultErr, boolean redirectOutputs) throws JahiaRuntimeException
${variable} (optional) and a working directory (optional).
Buffers for process output and error stream can be provided.command - the command to be executedarguments - optional arguments for the commandparameterSubstitutionMap - optional values for variables to be expandedworkingDir - optional working directory for the process to be started fromresultOut - the buffer to write the process execution output into (optional)resultErr - the buffer to write the process execution error into (optional)JahiaRuntimeException - in case the process execution failedCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.