use of com.thoughtworks.go.util.DirectoryReader in project gocd by gocd.
the class StageDetailPresentationModel method getArtifactFiles.
public DirectoryEntries getArtifactFiles() throws IllegalArtifactLocationException {
JobInstances withNonEmptyArtifacts = stage.getJobInstances();
DirectoryEntries artifacts = new DirectoryEntries();
for (JobInstance instance : withNonEmptyArtifacts) {
DirectoryReader directoryReader = new DirectoryReader(instance.getIdentifier());
DirectoryEntries subDirectories = directoryReader.listEntries(artifactsService.findArtifact(instance.getIdentifier(), ""), "");
artifacts.add(new FolderDirectoryEntry(instance.getName(), "", subDirectories));
}
return artifacts;
}
Aggregations