Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-72500] Allow accessing file parameter values from Runs #8830

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/model/FileParameterValue.java
Expand Up @@ -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);
}
Expand All @@ -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);
}

Expand Down