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 16 package ohos; 17 18 import java.util.ArrayList; 19 import java.util.HashMap; 20 import java.util.Map; 21 import java.util.List; 22 23 /** 24 * Hap zip info 25 * 26 */ 27 class HapZipInfo { 28 private byte[] resDataBytes; 29 private String harmonyProfileJsonStr = ""; 30 private String packInfoJsonStr = ""; 31 private String hapFileName = ""; 32 public HashMap<String, String> resourcemMap = new HashMap<>(); 33 34 /** 35 * Get resource data bytes. 36 * 37 * @return resource data bytes. 38 */ getResDataBytes()39 public byte[] getResDataBytes() { 40 return resDataBytes; 41 } 42 43 /** 44 * Set resource data bytes. 45 * 46 * @param resDataBytes Indicates the resource data bytes. 47 */ setResDataBytes(byte[] resDataBytes)48 public void setResDataBytes(byte[] resDataBytes) { 49 this.resDataBytes = resDataBytes; 50 } 51 52 /** 53 * Get harmony profile json string. 54 * 55 * @return harmony profile json string. 56 */ getHarmonyProfileJsonStr()57 public String getHarmonyProfileJsonStr() { 58 return harmonyProfileJsonStr; 59 } 60 61 /** 62 * Set harmony profile json string. 63 * 64 * @param harmonyProfileJsonStr Indicates harmony profile json string. 65 */ setHarmonyProfileJsonStr(String harmonyProfileJsonStr)66 public void setHarmonyProfileJsonStr(String harmonyProfileJsonStr) { 67 this.harmonyProfileJsonStr = harmonyProfileJsonStr; 68 } 69 70 /** 71 * Get pack.info json string. 72 * 73 * @return pack.info json string. 74 */ getPackInfoJsonStr()75 public String getPackInfoJsonStr() { 76 return packInfoJsonStr; 77 } 78 79 /** 80 * Set pack.info json string. 81 * 82 * @param packInfoJsonStr Indicates the pack.info json string. 83 */ setPackInfoJsonStr(String packInfoJsonStr)84 public void setPackInfoJsonStr(String packInfoJsonStr) { 85 this.packInfoJsonStr = packInfoJsonStr; 86 } 87 88 /** 89 * Get hap file name. 90 * 91 * @return hap file name. 92 */ getHapFileName()93 public String getHapFileName() { 94 return hapFileName; 95 } 96 97 /** 98 * Set hap file name. 99 * 100 * @param hapFileName Indicates the hap file name. 101 */ setHapFileName(String hapFileName)102 public void setHapFileName(String hapFileName) { 103 this.hapFileName = hapFileName; 104 } 105 106 /** 107 * push json file to map. 108 * 109 * @param fileName Indicates the file name of json file. 110 * @param fileContent Indicates the file content of json file. 111 */ pushResourceMap(String fileName, String fileContent)112 public void pushResourceMap(String fileName, String fileContent) { 113 if (fileName == null || fileContent == null) { 114 return; 115 } 116 resourcemMap.put(fileName, fileContent); 117 } 118 } 119