Class FileParametersSupport
java.lang.Object
io.jenkins.plugins.batchcontrol.store.FileParametersSupport
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class FileParametersSupport
extends Object
The only place where Batch Control uses the optional file-parameters plugin
(
stashedFile, base64File). It calls the plugin's public API directly.
The plugin may be missing, so every method first checks that it is installed and active
(isInstalled()). Only then does it touch the nested Linked class, the one class
that refers to the plugin's types. Without the plugin Linked is never loaded, and each
method answers as it would for a value or definition of any other type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisposeCancelled(Queue.LeftItem cancelled) Hands the cancelled queue itemcancelledto the plugin's own listener for cancelled items,StashedFileParameterValue.CancelledQueueListener.static StringfileName(ParameterValue value) The original file name of one of the plugin's file values, asAbstractFileParameterValue#getFilename()returns it;nullfor any other value.static booleanisFileDefinition(ParameterDefinition definition) Whetherdefinitionis one of the plugin's file definitions (stashedFile,base64File).static booleanisFileValue(ParameterValue value) Whethervalueis one of the plugin's file values (stashedFile,base64File).static booleanWhether the file-parameters plugin is installed and active.static booleankeepsTemporaryFile(ParameterValue value) Whethervalueis the plugin's stashed file value.
-
Method Details
-
isInstalled
public static boolean isInstalled()Whether the file-parameters plugin is installed and active. -
isFileValue
Whethervalueis one of the plugin's file values (stashedFile,base64File). -
fileName
The original file name of one of the plugin's file values, asAbstractFileParameterValue#getFilename()returns it;nullfor any other value. -
keepsTemporaryFile
Whethervalueis the plugin's stashed file value. Such a value keeps its upload in a temporary file under$JENKINS_HOME/stashedFileParameterValueFiles/until its build takes the file over. A Base64 file value keeps its content in the value itself. -
isFileDefinition
Whetherdefinitionis one of the plugin's file definitions (stashedFile,base64File). Their common base class is not public, so both are named. -
disposeCancelled
Hands the cancelled queue itemcancelledto the plugin's own listener for cancelled items,StashedFileParameterValue.CancelledQueueListener. That listener deletes the temporary file of each stashed value the item carries. The plugin offers no other public way to delete that file: the value does not expose it and has no delete method. Does nothing without the plugin.
-