|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.owasp.esapi.reference.DefaultExecutor
public class DefaultExecutor
Reference implementation of the Executor interface. This implementation is very restrictive. Commands must exactly equal the canonical path to an executable on the system.
Valid characters for parameters are codec dependent, but will usually only include alphanumeric, forward-slash, and dash.
Executor
Method Summary | |
---|---|
java.lang.String |
executeSystemCommand(java.io.File executable,
java.util.List params)
Invokes the specified executable with default workdir and codec and not logging parameters. |
java.lang.String |
executeSystemCommand(java.io.File executable,
java.util.List params,
java.io.File workdir,
Codec codec,
boolean logParams)
Executes a system command after checking that the executable exists and escaping all the parameters to ensure that injection is impossible. |
static Executor |
getInstance()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Executor getInstance()
public java.lang.String executeSystemCommand(java.io.File executable, java.util.List params) throws ExecutorException
executeSystemCommand
in interface Executor
executable
- the command to executeparams
- the parameters of the command being executed
ExecutorException
public java.lang.String executeSystemCommand(java.io.File executable, java.util.List params, java.io.File workdir, Codec codec, boolean logParams) 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 information
ExecutorException
- the service exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |