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 Details

    • isInstalled

      public static boolean isInstalled()
      Whether the file-parameters plugin is installed and active.
    • isFileValue

      public static boolean isFileValue(@CheckForNull ParameterValue value)
      Whether value is one of the plugin's file values (stashedFile, base64File).
    • fileName

      @CheckForNull public static String fileName(@CheckForNull ParameterValue value)
      The original file name of one of the plugin's file values, as AbstractFileParameterValue#getFilename() returns it; null for any other value.
    • keepsTemporaryFile

      public static boolean keepsTemporaryFile(@CheckForNull ParameterValue value)
      Whether value is 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

      public static boolean isFileDefinition(@CheckForNull ParameterDefinition definition)
      Whether definition is one of the plugin's file definitions (stashedFile, base64File). Their common base class is not public, so both are named.
    • disposeCancelled

      public static void disposeCancelled(Queue.LeftItem cancelled)
      Hands the cancelled queue item cancelled to 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.