public class ExecServiceImpl extends Object implements ExecService
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
execEnv(Map<String,String> env)
Build the environment used for all exec calls.
|
static ExecServiceImpl |
getInstance()
Retrieve the singleton.
|
ExecBean |
run(String program,
List<String> args,
Map<String,String> env)
Run the program synchronously as the given user.
|
ExecBean |
runUnlimited(String program,
List<String> args,
Map<String,String> env)
Run the program synchronously as the given user.
|
String |
validateProgram(String path)
Given a program name, lookup the fully qualified path.
|
public static ExecServiceImpl getInstance()
public ExecBean run(String program, List<String> args, Map<String,String> env) throws NotAuthorizedException, BusyException, org.apache.commons.exec.ExecuteException, IOException
run in interface ExecServiceprogram - The program to runargs - Arguments to pass to the programenv - Any extra environment variables to setNotAuthorizedExceptionBusyExceptionorg.apache.commons.exec.ExecuteExceptionIOExceptionpublic ExecBean runUnlimited(String program, List<String> args, Map<String,String> env) throws NotAuthorizedException, org.apache.commons.exec.ExecuteException, IOException
runUnlimited in interface ExecServiceprogram - The program to run.args - Arguments to pass to the programenv - Any extra environment variables to setNotAuthorizedExceptionorg.apache.commons.exec.ExecuteExceptionIOExceptionpublic Map<String,String> execEnv(Map<String,String> env)
public String validateProgram(String path) throws NotAuthorizedException, IOException
path - The path of the program.NotAuthorizedExceptionIOExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.