@ Override public File writeScriptToTempFile ( StepExecutionContext context , INodeEntry node , String scriptString , String serverScriptFilePath , InputStream scriptAsStream , boolean expandTokens ) throws FileCopierException { File temp ; if ( null != scriptString ) { //expand tokens in the script temp = fileCopierUtil . writeScriptTempFile ( context , null , null , scriptString , node , expandTokens ) ; } else if ( null != serverScriptFilePath ) { //DON'T expand tokens in the script //TODO: make token expansion optional for local file sources temp = new File ( serverScriptFilePath ) ; } else { //expand tokens in the script temp = fileCopierUtil . writeScriptTempFile ( context , null , scriptAsStream , null , node , expandTokens ) ; } return temp ; }
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