public class DefaultExecutor extends Object implements Executor
Valid characters for parameters are codec dependent, but will usually only include alphanumeric, forward-slash, and dash.
Executor
Modifier and Type | Method and Description |
---|---|
ExecuteResult |
executeSystemCommand(File executable,
List params)
Invokes the specified executable with default workdir and codec and not logging parameters.
|
ExecuteResult |
executeSystemCommand(File executable,
List params,
File workdir,
Codec codec,
boolean logParams,
boolean redirectErrorStream)
Executes a system command after checking that the executable exists and
escaping all the parameters to ensure that injection is impossible.
|
static Executor |
getInstance() |
public static Executor getInstance()
public ExecuteResult executeSystemCommand(File executable, List params) throws ExecutorException
executeSystemCommand
in interface Executor
executable
- the command to executeparams
- the parameters of the command being executedExecutorException
public ExecuteResult executeSystemCommand(File executable, List params, File workdir, Codec codec, boolean logParams, boolean redirectErrorStream) throws ExecutorException
executeSystemCommand
in interface Executor
executable
- the command to executeparams
- the parameters of the command being executedworkdir
- the working directorycodec
- the codec to use to encode for the particular OS in uselogParams
- use false if any parameters contains sensitive or confidential informationExecutorException
- the service exceptionCopyright © 2023 The Open Worldwide Application Security Project (OWASP). All rights reserved.