001    package org.kuali.common.util.file.model;
002    
003    import java.util.List;
004    
005    import com.google.common.collect.ImmutableList;
006    
007    public final class RepoArtifacts {
008    
009            public RepoArtifacts(Repository repository, List<Artifact> artifacts) {
010                    this.repository = repository;
011                    this.artifacts = ImmutableList.copyOf(artifacts);
012                    this.size = getSize(artifacts);
013            }
014    
015            private static long getSize(List<Artifact> artifacts) {
016                    long size = 0;
017                    for (Artifact artifact : artifacts) {
018                            size += artifact.getFile().getSize();
019                    }
020                    return size;
021            }
022    
023            private final Repository repository;
024            private final List<Artifact> artifacts;
025            private final long size;
026    
027            public Repository getRepository() {
028                    return repository;
029            }
030    
031            public List<Artifact> getArtifacts() {
032                    return artifacts;
033            }
034    
035            public long getSize() {
036                    return size;
037            }
038    }