예제 #1
0
 /**
  * Return a temporary filepath for a file to be copied to the node, given the input filename
  * (without directory path)
  *
  * @param node the destination node
  * @param project project
  * @param framework framework
  * @param scriptfileName the name of the file to copy
  * @param fileExtension optional extension to use for the temp file, or null for default
  * @param identity unique identifier, or null to include a random string
  * @return a filepath specifying destination of the file to copy that should be unique
  */
 public static String generateRemoteFilepathForNode(
     final INodeEntry node,
     final IRundeckProject project,
     final IFramework framework,
     final String scriptfileName,
     final String fileExtension,
     final String identity) {
   return util.generateRemoteFilepathForNode(
       node, project, framework, scriptfileName, fileExtension, identity);
 }
예제 #2
0
 /**
  * Return a remote destination temp dir path for the given node. If specified, the node attribute
  * named {@value #FILE_COPY_DESTINATION_DIR} is used, otherwise a temp directory appropriate for
  * the os-family of the node is returned.
  *
  * @param node the node entry
  * @return a path to destination dir for the node
  */
 public static String getRemoteDirForNode(final INodeEntry node) {
   return util.getRemoteDirForNode(node);
 }
예제 #3
0
 /**
  * @return a string with a file extension appended if it is not already on the file path provided.
  * @param filepath the file path string
  * @param fileext the file extension, if it does not start with a "." one will be prepended first.
  *     If null, the unmodified filepath will be returned.
  */
 public static String appendRemoteFileExtension(final String filepath, final String fileext) {
   return util.appendRemoteFileExtension(filepath, fileext);
 }
예제 #4
0
 /**
  * @param original source file
  * @param input source stream
  * @param script source string
  * @param destinationFile destination
  * @return local file
  * @throws FileCopierException on error
  */
 protected static File writeLocalFile(
     File original, InputStream input, String script, File destinationFile)
     throws FileCopierException {
   return util.writeLocalFile(original, input, script, destinationFile);
 }
예제 #5
0
 /**
  * Write the file, stream, or text to a local temp file and return the file
  *
  * @param context context
  * @param original source file, or null
  * @param input source inputstream or null
  * @param script source text, or null
  * @return temp file, this file should later be cleaned up by calling {@link
  *     com.dtolabs.rundeck.core.execution.script.ScriptfileUtils#releaseTempFile(java.io.File)}
  * @throws FileCopierException if IOException occurs
  */
 public static File writeTempFile(
     ExecutionContext context, File original, InputStream input, String script)
     throws FileCopierException {
   return util.writeTempFile(context, original, input, script);
 }
예제 #6
0
 /**
  * Return a remote destination temp dir path for the given node. If specified, the node attribute
  * named {@value #FILE_COPY_DESTINATION_DIR} is used, otherwise a temp directory appropriate for
  * the os-family of the node is returned.
  *
  * @param node the node entry
  * @param project project
  * @param framework framework
  * @return a path to destination dir for the node
  */
 public static String getRemoteDirForNode(
     final INodeEntry node, final IRundeckProject project, final IFramework framework) {
   return util.getRemoteDirForNode(node, project, framework);
 }