|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dtolabs.rundeck.core.utils.ScriptExecUtil
public class ScriptExecUtil
Provides methods for running scripts/commands.
Constructor Summary | |
---|---|
ScriptExecUtil()
|
Method Summary | |
---|---|
static ExecArgList |
createScriptArgList(java.lang.String filepath,
java.lang.String scriptargs,
java.lang.String[] scriptargsarr,
java.lang.String scriptinterpreter,
boolean interpreterargsquoted)
Generate argument array for a script file invocation |
static java.lang.String[] |
createScriptArgs(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> localDataContext,
INodeEntry node,
java.lang.String scriptargs,
java.lang.String[] scriptargsarr,
java.lang.String scriptinterpreter,
boolean interpreterargsquoted,
java.lang.String filepath)
Generate argument array for a script file invocation |
static java.lang.String[] |
createScriptArgs(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> localDataContext,
java.lang.String scriptargs,
java.lang.String[] scriptargsarr,
java.lang.String scriptinterpreter,
boolean interpreterargsquoted,
java.lang.String filepath)
Generate argument array for a script file invocation |
static int |
runLocalCommand(java.lang.String[] command,
java.util.Map<java.lang.String,java.lang.String> envMap,
java.io.File workingdir,
java.io.OutputStream outputStream,
java.io.OutputStream errorStream)
Run a command with environment variables in a working dir, and copy the streams |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptExecUtil()
Method Detail |
---|
public static int runLocalCommand(java.lang.String[] command, java.util.Map<java.lang.String,java.lang.String> envMap, java.io.File workingdir, java.io.OutputStream outputStream, java.io.OutputStream errorStream) throws java.io.IOException, java.lang.InterruptedException
command
- the command array to runenvMap
- the environment variables to pass inworkingdir
- optional working dir location (or null)outputStream
- stream for stdouterrorStream
- stream for stderr
java.io.IOException
- if any IO exception occurs
java.lang.InterruptedException
- if interrupted while waiting for the command to finishpublic static java.lang.String[] createScriptArgs(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> localDataContext, java.lang.String scriptargs, java.lang.String[] scriptargsarr, java.lang.String scriptinterpreter, boolean interpreterargsquoted, java.lang.String filepath)
localDataContext
- data context properties to expand among the argsscriptargs
- arguments to the script filescriptargsarr
- arguments to the script file as an arrayscriptinterpreter
- interpreter invocation for the file, or null to invoke it directlyinterpreterargsquoted
- if true, pass the script file and args as a single argument to the interpreterfilepath
- remote filepath for the scriptpublic static ExecArgList createScriptArgList(java.lang.String filepath, java.lang.String scriptargs, java.lang.String[] scriptargsarr, java.lang.String scriptinterpreter, boolean interpreterargsquoted)
filepath
- remote filepath for the scriptscriptargs
- arguments to the script filescriptargsarr
- arguments to the script file as an arrayscriptinterpreter
- interpreter invocation for the file, or null to invoke it directlyinterpreterargsquoted
- if true, pass the script file and args as a single argument to the interpreterpublic static java.lang.String[] createScriptArgs(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> localDataContext, INodeEntry node, java.lang.String scriptargs, java.lang.String[] scriptargsarr, java.lang.String scriptinterpreter, boolean interpreterargsquoted, java.lang.String filepath)
localDataContext
- data context properties to expand among the argsnode
- node to use for os-type argument quoting.scriptargs
- arguments to the script filescriptargsarr
- arguments to the script file as an arrayscriptinterpreter
- interpreter invocation for the file, or null to invoke it directlyinterpreterargsquoted
- if true, pass the script file and args as a single argument to the interpreterfilepath
- remote filepath for the script
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |