Interface ScriptFileNodeStepUtils

    • 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 - context
        node - node
        scriptString - string
        serverScriptFilePath - file
        scriptAsStream - stream
        fileExtension - file extension
        args - script args
        scriptInterpreter - invoker string
        quoted - true if args are quoted
        executionService - 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 - context
        node - node
        scriptString - string
        serverScriptFilePath - file
        scriptAsStream - 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 - context
        framework - framework
        node - the node
        args - arguments to script
        filepath - 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 - context
        framework - framework
        node - the node
        args - arguments to script
        filepath - the remote path for the script
        scriptInterpreter - interpreter used to invoke the script
        interpreterargsquoted - 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 - context
        framework - framework
        node - the node
        args - arguments to script
        filepath - the remote path for the script
        scriptInterpreter - interpreter used to invoke the script
        interpreterargsquoted - if true, pass the file and script args as a single argument to the interpreter
        removeFile - 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 - path
        osFamily - family
        Returns:
        arg list