Search in sources :

Example 1 with DirectoryReader

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;
}
Also used : FolderDirectoryEntry(com.thoughtworks.go.domain.FolderDirectoryEntry) DirectoryEntries(com.thoughtworks.go.domain.DirectoryEntries) JobInstance(com.thoughtworks.go.domain.JobInstance) DirectoryReader(com.thoughtworks.go.util.DirectoryReader) JobInstances(com.thoughtworks.go.domain.JobInstances)

Aggregations

DirectoryEntries (com.thoughtworks.go.domain.DirectoryEntries)1 FolderDirectoryEntry (com.thoughtworks.go.domain.FolderDirectoryEntry)1 JobInstance (com.thoughtworks.go.domain.JobInstance)1 JobInstances (com.thoughtworks.go.domain.JobInstances)1 DirectoryReader (com.thoughtworks.go.util.DirectoryReader)1