From fba0acd61066625608b288d7e678de8f584d8f3b Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Thu, 4 Jan 2024 21:37:35 +0100 Subject: [PATCH] [JENKINS-72500] Allow accessing file parameter values from Runs --- core/src/main/java/hudson/model/FileParameterValue.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/FileParameterValue.java b/core/src/main/java/hudson/model/FileParameterValue.java index e9e30e63463b..e3623db2e075 100644 --- a/core/src/main/java/hudson/model/FileParameterValue.java +++ b/core/src/main/java/hudson/model/FileParameterValue.java @@ -227,7 +227,7 @@ public String toString() { * Serve this file parameter in response to a {@link StaplerRequest}. */ public DirectoryBrowserSupport doDynamic(StaplerRequest request, StaplerResponse response) { - AbstractBuild build = (AbstractBuild) request.findAncestor(AbstractBuild.class).getObject(); + Run build = (Run) request.findAncestor(Run.class).getObject(); File fileParameter = getFileParameterFolderUnderBuild(build); return new DirectoryBrowserSupport(build, new FilePath(fileParameter), Messages.FileParameterValue_IndexTitle(), "folder.png", false); } @@ -238,11 +238,11 @@ public DirectoryBrowserSupport doDynamic(StaplerRequest request, StaplerResponse * @param build the build * @return the location to store the file parameter */ - private File getLocationUnderBuild(AbstractBuild build) { + private File getLocationUnderBuild(Run build) { return new File(getFileParameterFolderUnderBuild(build), location); } - private File getFileParameterFolderUnderBuild(AbstractBuild build) { + private File getFileParameterFolderUnderBuild(Run build) { return new File(build.getRootDir(), FOLDER_NAME); }