1/*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16package ohos;
17
18import java.util.HashMap;
19
20/**
21 * Hap zip info
22 *
23 */
24class HapZipInfo {
25    private byte[] resDataBytes;
26    private String harmonyProfileJsonStr = "";
27    private String packInfoJsonStr = "";
28    private String hapFileName = "";
29    public HashMap<String, String> resourcemMap = new HashMap<>();
30
31    /**
32     * Get resource data bytes.
33     *
34     * @return resource data bytes.
35     */
36    public byte[] getResDataBytes() {
37        return resDataBytes;
38    }
39
40    /**
41     * Set resource data bytes.
42     *
43     * @param resDataBytes Indicates the resource data bytes.
44     */
45    public void setResDataBytes(byte[] resDataBytes) {
46        this.resDataBytes = resDataBytes;
47    }
48
49    /**
50     * Get harmony profile json string.
51     *
52     * @return harmony profile json string.
53     */
54    public String getHarmonyProfileJsonStr() {
55        return harmonyProfileJsonStr;
56    }
57
58    /**
59     * Set harmony profile json string.
60     *
61     * @param harmonyProfileJsonStr Indicates harmony profile json string.
62     */
63    public void setHarmonyProfileJsonStr(String harmonyProfileJsonStr) {
64        this.harmonyProfileJsonStr = harmonyProfileJsonStr;
65    }
66
67    /**
68     * Get pack.info json string.
69     *
70     * @return pack.info json string.
71     */
72    public String getPackInfoJsonStr() {
73        return packInfoJsonStr;
74    }
75
76    /**
77     * Set pack.info json string.
78     *
79     * @param packInfoJsonStr Indicates the pack.info json string.
80     */
81    public void setPackInfoJsonStr(String packInfoJsonStr) {
82        this.packInfoJsonStr = packInfoJsonStr;
83    }
84
85    /**
86     * Get hap file name.
87     *
88     * @return hap file name.
89     */
90    public String getHapFileName() {
91        return hapFileName;
92    }
93
94    /**
95     * Set hap file name.
96     *
97     * @param hapFileName Indicates the hap file name.
98     */
99    public void setHapFileName(String hapFileName) {
100        this.hapFileName = hapFileName;
101    }
102
103    /**
104     * push json file to map.
105     *
106     * @param fileName Indicates the file name of json file.
107     * @param fileContent Indicates the file content of json file.
108     */
109    public void pushResourceMap(String fileName, String fileContent) {
110        if (fileName == null || fileContent == null) {
111            return;
112        }
113        resourcemMap.put(fileName, fileContent);
114    }
115}
116