Skip to content

Commit

Permalink
Might as well handle containsSymLink the same way. Will never matte…
Browse files Browse the repository at this point in the history
…r for artifact display with either the built-in or pluggable managers, but could improve performance of workspace listing with slow agent connections.
  • Loading branch information
jglick committed Jan 17, 2024
1 parent da2966a commit d9abc68
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/main/java/hudson/model/DirectoryBrowserSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ private void serveFile(StaplerRequest req, StaplerResponse rsp, VirtualFile root
// serve directory index
var result = baseFile.run(new BuildChildPaths(baseFile, req.getLocale(), getOpenOptions()));
glob = result.glob;
containsSymlink = baseFile.containsSymLinkChild(getOpenOptions());
containsSymlink = result.containsSymLink;
containsTmpDir = result.containsTmpDir;
}

Expand Down Expand Up @@ -751,9 +751,11 @@ private int dirRank(VirtualFile f) {
private static final class BuildChildPathsResult implements Serializable { // TODO Java 21+ record
private static final long serialVersionUID = 1;
private final List<List<Path>> glob;
private final boolean containsSymLink;
private final boolean containsTmpDir;
BuildChildPathsResult(List<List<Path>> glob, boolean containsTmpDir) {
BuildChildPathsResult(List<List<Path>> glob, boolean containsSymLink, boolean containsTmpDir) {
this.glob = glob;
this.containsSymLink = containsSymLink;
this.containsTmpDir = containsTmpDir;
}
}
Expand All @@ -769,7 +771,7 @@ private static final class BuildChildPaths extends MasterToSlaveCallable<BuildCh
}

@Override public BuildChildPathsResult call() throws IOException {
return new BuildChildPathsResult(buildChildPaths(cur, locale), cur.containsTmpDirChild(openOptions));
return new BuildChildPathsResult(buildChildPaths(cur, locale), cur.containsSymLinkChild(openOptions), cur.containsTmpDirChild(openOptions));
}
}
/**
Expand Down

0 comments on commit d9abc68

Please sign in to comment.