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 2 commits 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/model/FileParameterValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public String toString() {
* Serve this file parameter in response to a {@link StaplerRequest2}.
*/
public DirectoryBrowserSupport doDynamic(StaplerRequest2 request, StaplerResponse2 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 @@ -249,11 +249,11 @@ public DirectoryBrowserSupport doDynamic(StaplerRequest2 request, StaplerRespons
* @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
Loading