|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dtolabs.rundeck.core.execution.impl.common.BaseFileCopier
public class BaseFileCopier
BaseFileCopier provides utility methods for a FileCopier class.
Field Summary | |
---|---|
static java.lang.String |
FILE_COPY_DESTINATION_DIR
|
Constructor Summary | |
---|---|
BaseFileCopier()
|
Method Summary | |
---|---|
static java.lang.String |
appendRemoteFileExtensionForNode(INodeEntry node,
java.lang.String filepath)
Return a string with an appropriate script file extension appended if it is not already on the file path provided. |
static 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) |
static java.lang.String |
getRemoteDirForNode(INodeEntry node)
Return a remote destination temp dir path for the given node. |
protected static java.io.File |
writeLocalFile(java.io.File original,
java.io.InputStream input,
java.lang.String script,
java.io.File destinationFile)
|
static java.io.File |
writeScriptTempFile(ExecutionContext context,
java.io.File original,
java.io.InputStream input,
java.lang.String script,
INodeEntry node)
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. |
protected static java.io.File |
writeTempFile(ExecutionContext context,
java.io.File original,
java.io.InputStream input,
java.lang.String script)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_COPY_DESTINATION_DIR
Constructor Detail |
---|
public BaseFileCopier()
Method Detail |
---|
public static java.io.File writeScriptTempFile(ExecutionContext context, java.io.File original, java.io.InputStream input, java.lang.String script, INodeEntry node) 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 context
ExecutionException
- if an IO problem occurs
FileCopierException
public static java.lang.String appendRemoteFileExtensionForNode(INodeEntry node, java.lang.String filepath)
node
- node destinationfilepath
- the file path stringpublic static java.lang.String getRemoteDirForNode(INodeEntry node)
node
- the node entry
public static java.lang.String generateRemoteFilepathForNode(INodeEntry node, java.lang.String scriptfileName)
node
- the destination nodescriptfileName
- the name of the file to copy
protected static java.io.File writeTempFile(ExecutionContext context, java.io.File original, java.io.InputStream input, java.lang.String script) throws FileCopierException
FileCopierException
protected static java.io.File writeLocalFile(java.io.File original, java.io.InputStream input, java.lang.String script, java.io.File destinationFile) throws FileCopierException
FileCopierException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |