1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.tradefed.cluster;
17 
18 import com.android.tradefed.build.DeviceFolderBuildInfo;
19 import com.android.tradefed.build.IBuildInfo;
20 
21 import java.io.File;
22 import java.util.ArrayList;
23 import java.util.Collections;
24 import java.util.List;
25 
26 /** A {@link IBuildInfo} class for builds piped from TFC. */
27 public class ClusterBuildInfo extends DeviceFolderBuildInfo {
28 
29     private List<File> mZipMounts = new ArrayList<>();
30 
ClusterBuildInfo(File rootDir, String buildId, String buildName)31     public ClusterBuildInfo(File rootDir, String buildId, String buildName) {
32         super(buildId, buildName);
33         setRootDir(rootDir);
34     }
35 
36     /**
37      * Return zip mount points associated with this build info.
38      *
39      * @return a list of zip mount points.
40      */
getZipMounts()41     List<File> getZipMounts() {
42         return Collections.unmodifiableList(mZipMounts);
43     }
44 
45     /**
46      * Add a zip mount point.
47      *
48      * @param dir a path where a zip file is mounted at.
49      */
addZipMount(File dir)50     void addZipMount(File dir) {
51         mZipMounts.add(dir);
52     }
53 }
54