public interface FileCopierUtil
Modifier and Type | Method and Description |
---|---|
java.lang.String |
appendRemoteFileExtension(java.lang.String filepath,
java.lang.String fileext) |
java.lang.String |
defaultRemoteFileExtensionForNode(INodeEntry node) |
java.lang.String |
generateRemoteFilepathForNode(INodeEntry node,
IRundeckProject project,
IFramework framework,
java.lang.String scriptfileName,
java.lang.String fileExtension,
java.lang.String identity)
Return a temporary filepath for a file to be copied to the node, given the input filename (without directory
path)
|
java.lang.String |
generateRemoteFilepathForNode(INodeEntry node,
java.lang.String scriptfileName)
Return a temporary filepath for a file to be copied to the node, given the input filename (without directory
path)
|
java.lang.String |
generateRemoteFilepathForNode(INodeEntry node,
java.lang.String scriptfileName,
java.lang.String fileExtension)
Return a temporary filepath for a file to be copied to the node, given the input filename (without directory
path)
|
java.lang.String |
generateRemoteFilepathForNode(INodeEntry node,
java.lang.String scriptfileName,
java.lang.String fileExtension,
java.lang.String identity)
|
java.lang.String |
getRemoteDirForNode(INodeEntry node)
Return a remote destination temp dir path for the given node.
|
java.lang.String |
getRemoteDirForNode(INodeEntry node,
IRundeckProject project,
IFramework framework)
Return a remote destination temp dir path for the given node.
|
java.io.File |
writeLocalFile(java.io.File original,
java.io.InputStream input,
java.lang.String script,
java.io.File destinationFile) |
java.io.File |
writeScriptTempFile(ExecutionContext context,
java.io.File original,
java.io.InputStream input,
java.lang.String script,
INodeEntry node,
boolean expandTokens)
Copy a script file, script source stream, or script string into a temp file, and replace \
embedded tokens with values from the dataContext for the latter two.
|
java.io.File |
writeScriptTempFile(ExecutionContext context,
java.io.File original,
java.io.InputStream input,
java.lang.String script,
INodeEntry node,
java.io.File destination,
boolean expandTokens)
Copy a script file, script source stream, or script string into a temp file, and replace \
embedded tokens with values from the dataContext for the latter two.
|
java.io.File |
writeTempFile(ExecutionContext context,
java.io.File original,
java.io.InputStream input,
java.lang.String script)
Write the file, stream, or text to a local temp file and return the file
|
java.io.File writeScriptTempFile(ExecutionContext context, java.io.File original, java.io.InputStream input, java.lang.String script, INodeEntry node, boolean expandTokens) throws FileCopierException
context
- execution contextoriginal
- local system file, or nullinput
- input stream to write, or nullscript
- file content string, or nullnode
- destination node entry, to provide node data contextexpandTokens
- if true, expand tokens in the stream or stringScriptfileUtils.releaseTempFile(java.io.File)
FileCopierException
- if an IO problem occursjava.io.File writeScriptTempFile(ExecutionContext context, java.io.File original, java.io.InputStream input, java.lang.String script, INodeEntry node, java.io.File destination, boolean expandTokens) throws FileCopierException
context
- execution contextoriginal
- local system file, or nullinput
- input stream to write, or nullscript
- file content string, or nullnode
- destination node entry, to provide node data contextdestination
- destination file, or null to generate a new temp fileexpandTokens
- if true, expand tokens in the stream or stringFileCopierException
- if an IO problem occursjava.lang.String defaultRemoteFileExtensionForNode(INodeEntry node)
node
- nodejava.lang.String appendRemoteFileExtension(java.lang.String filepath, java.lang.String fileext)
filepath
- the file path stringfileext
- the file extension, if it does not start with a "." one will be prepended
first. If null, the unmodified filepath will be returned.java.lang.String getRemoteDirForNode(INodeEntry node)
node
- the node entryjava.lang.String getRemoteDirForNode(INodeEntry node, IRundeckProject project, IFramework framework)
node
- the node entryproject
- projectframework
- frameworkjava.lang.String generateRemoteFilepathForNode(INodeEntry node, java.lang.String scriptfileName)
node
- the destination nodescriptfileName
- the name of the file to copyjava.lang.String generateRemoteFilepathForNode(INodeEntry node, java.lang.String scriptfileName, java.lang.String fileExtension)
node
- the destination nodescriptfileName
- the name of the file to copyfileExtension
- optional extension to use for the temp file, or null for defaultjava.lang.String generateRemoteFilepathForNode(INodeEntry node, java.lang.String scriptfileName, java.lang.String fileExtension, java.lang.String identity)
generateRemoteFilepathForNode(INodeEntry, IRundeckProject, IFramework, String, String, String)
node
- the destination nodescriptfileName
- the name of the file to copyfileExtension
- optional extension to use for the temp file, or null for defaultidentity
- unique identifier, or null to include a random stringjava.lang.String generateRemoteFilepathForNode(INodeEntry node, IRundeckProject project, IFramework framework, java.lang.String scriptfileName, java.lang.String fileExtension, java.lang.String identity)
node
- the destination nodeproject
- projectframework
- frameworkscriptfileName
- the name of the file to copyfileExtension
- optional extension to use for the temp file, or null for defaultidentity
- unique identifier, or null to include a random stringjava.io.File writeTempFile(ExecutionContext context, java.io.File original, java.io.InputStream input, java.lang.String script) throws FileCopierException
context
- contextoriginal
- source file, or nullinput
- source inputstream or nullscript
- source text, or nullScriptfileUtils.releaseTempFile(File)
FileCopierException
- if IOException occursjava.io.File writeLocalFile(java.io.File original, java.io.InputStream input, java.lang.String script, java.io.File destinationFile) throws FileCopierException
original
- source fileinput
- source streamscript
- source stringdestinationFile
- destinationFileCopierException
- on error