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 ExecService
program
- The program to runargs
- Arguments to pass to the programenv
- Any extra environment variables to setNotAuthorizedException
BusyException
org.apache.commons.exec.ExecuteException
IOException
public ExecBean runUnlimited(String program, List<String> args, Map<String,String> env) throws NotAuthorizedException, org.apache.commons.exec.ExecuteException, IOException
runUnlimited
in interface ExecService
program
- The program to run.args
- Arguments to pass to the programenv
- Any extra environment variables to setNotAuthorizedException
org.apache.commons.exec.ExecuteException
IOException
public Map<String,String> execEnv(Map<String,String> env)
public String validateProgram(String path) throws NotAuthorizedException, IOException
path
- The path of the program.NotAuthorizedException
IOException
Copyright © 2017 The Apache Software Foundation. All rights reserved.