Class ParameterFiles
Two parameter types keep such a file: core's FileParameterValue
($JENKINS_HOME/fileParameterValueFiles/) and the file-parameters plugin's stashed file
value ($JENKINS_HOME/stashedFileParameterValueFiles/, through
FileParametersSupport when that plugin is installed). The plugin's Base64 file value keeps
its content in the value itself.
D-74 (2): why a cancelled queue item. Neither type exposes its temporary file or a method that
deletes it (core's FileParameterValue#getFile2() returns the upload, not the copy it
keeps). The only supported cleanup each offers is its public listener for cancelled queue items,
FileParameterValue.CancelledQueueListener and
StashedFileParameterValue.CancelledQueueListener. Each deletes the temporary files of its
own values in a cancelled Queue.LeftItem. So this class calls exactly those two
listeners, by their classes, with a cancelled item that carries the values. No other queue
listener is called, nothing enters the queue, and no private field is read. A listener that
fails is logged; the listeners log their own failed deletions. A value of any other type is left
alone.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddispose(List<? extends ParameterValue> values, String owner) Disposes of the temporary files held byvalues, which must never be (or have been) handed to the queue.static booleankeepsTemporaryFile(ParameterValue value) Whethervaluekeeps a temporary file until its build takes it over: core's file value or the file-parameters plugin's stashed file value.
-
Method Details
-
dispose
Disposes of the temporary files held byvalues, which must never be (or have been) handed to the queue.ownernames them in the log (a request id, a refused submission). Never throws: what cannot be disposed of is logged. -
keepsTemporaryFile
Whethervaluekeeps a temporary file until its build takes it over: core's file value or the file-parameters plugin's stashed file value. Such a value of a completed build cannot be reused as it is: its build consumed the file.
-