Interface ScriptFileNodeStepUtils
-
- All Known Implementing Classes:
DefaultScriptFileNodeStepUtils
public interface ScriptFileNodeStepUtils
Created by greg on 7/15/16.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NodeStepResult
executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath)
Execute a scriptfile already copied to a remote node with the given argsNodeStepResult
executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath, java.lang.String scriptInterpreter, boolean interpreterargsquoted)
Execute a scriptfile already copied to a remote node with the given argsNodeStepResult
executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath, java.lang.String scriptInterpreter, boolean interpreterargsquoted, boolean removeFile)
Execute a scriptfile already copied to a remote node with the given argsNodeStepResult
executeScriptFile(StepExecutionContext context, INodeEntry node, java.lang.String scriptString, java.lang.String serverScriptFilePath, java.io.InputStream scriptAsStream, java.lang.String fileExtension, java.lang.String[] args, java.lang.String scriptInterpreter, boolean quoted, NodeExecutionService executionService, boolean expandTokens)
Execute a script on a remote nodeExecArgList
removeArgsForOsFamily(java.lang.String filepath, java.lang.String osFamily)
Return ExecArgList for removing a file for the given OS familyjava.io.File
writeScriptToTempFile(StepExecutionContext context, INodeEntry node, java.lang.String scriptString, java.lang.String serverScriptFilePath, java.io.InputStream scriptAsStream, boolean expandTokens)
Copy the script input to a temp file and expand embedded tokens, if it is a string or inputstream.
-
-
-
Method Detail
-
executeScriptFile
NodeStepResult executeScriptFile(StepExecutionContext context, INodeEntry node, java.lang.String scriptString, java.lang.String serverScriptFilePath, java.io.InputStream scriptAsStream, java.lang.String fileExtension, java.lang.String[] args, java.lang.String scriptInterpreter, boolean quoted, NodeExecutionService executionService, boolean expandTokens) throws NodeStepException
Execute a script on a remote node- Parameters:
context
- contextnode
- nodescriptString
- stringserverScriptFilePath
- filescriptAsStream
- streamfileExtension
- file extensionargs
- script argsscriptInterpreter
- invoker stringquoted
- true if args are quotedexecutionService
- service- Returns:
- execution result
- Throws:
NodeStepException
- on error
-
writeScriptToTempFile
java.io.File writeScriptToTempFile(StepExecutionContext context, INodeEntry node, java.lang.String scriptString, java.lang.String serverScriptFilePath, java.io.InputStream scriptAsStream, boolean expandTokens) throws FileCopierException
Copy the script input to a temp file and expand embedded tokens, if it is a string or inputstream. If it is a local file, use the original without modification- Parameters:
context
- contextnode
- nodescriptString
- stringserverScriptFilePath
- filescriptAsStream
- stream- Returns:
- temp file
- Throws:
FileCopierException
- on error
-
executeRemoteScript
NodeStepResult executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath) throws NodeStepException
Execute a scriptfile already copied to a remote node with the given args- Parameters:
context
- contextframework
- frameworknode
- the nodeargs
- arguments to scriptfilepath
- the remote path for the script- Returns:
- the result
- Throws:
NodeStepException
- on error
-
executeRemoteScript
NodeStepResult executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath, java.lang.String scriptInterpreter, boolean interpreterargsquoted) throws NodeStepException
Execute a scriptfile already copied to a remote node with the given args- Parameters:
context
- contextframework
- frameworknode
- the nodeargs
- arguments to scriptfilepath
- the remote path for the scriptscriptInterpreter
- interpreter used to invoke the scriptinterpreterargsquoted
- if true, pass the file and script args as a single argument to the interpreter- Returns:
- result
- Throws:
NodeStepException
- on error
-
executeRemoteScript
NodeStepResult executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath, java.lang.String scriptInterpreter, boolean interpreterargsquoted, boolean removeFile) throws NodeStepException
Execute a scriptfile already copied to a remote node with the given args- Parameters:
context
- contextframework
- frameworknode
- the nodeargs
- arguments to scriptfilepath
- the remote path for the scriptscriptInterpreter
- interpreter used to invoke the scriptinterpreterargsquoted
- if true, pass the file and script args as a single argument to the interpreterremoveFile
- if true, remove the file after execution- Returns:
- result
- Throws:
NodeStepException
- on error
-
removeArgsForOsFamily
ExecArgList removeArgsForOsFamily(java.lang.String filepath, java.lang.String osFamily)
Return ExecArgList for removing a file for the given OS family- Parameters:
filepath
- pathosFamily
- family- Returns:
- arg list
-
-