• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 com.ohos.hapsigntool.zip;
17 
18 import java.nio.ByteBuffer;
19 
20 /**
21  * Information of ZIP file
22  *
23  * @since 2021/12/20
24  */
25 public class ZipFileInfo {
26     private final long centralDirectoryOffset;
27     private final int centralDirectorySize;
28     private final int centralDirectoryEntryCount;
29     private final long eocdOffset;
30     private final ByteBuffer eocd;
31 
ZipFileInfo(long centralDirectoryOffset, int centralDirectorySize, int centralDirectoryEntryCount, long eocdOffset, ByteBuffer eocd)32     public ZipFileInfo(long centralDirectoryOffset, int centralDirectorySize, int centralDirectoryEntryCount,
33         long eocdOffset, ByteBuffer eocd) {
34         this.centralDirectoryOffset = centralDirectoryOffset;
35         this.centralDirectorySize = centralDirectorySize;
36         this.centralDirectoryEntryCount = centralDirectoryEntryCount;
37         this.eocdOffset = eocdOffset;
38         this.eocd = eocd;
39     }
40 
getCentralDirectoryOffset()41     public long getCentralDirectoryOffset() {
42         return centralDirectoryOffset;
43     }
44 
getCentralDirectorySize()45     public int getCentralDirectorySize() {
46         return centralDirectorySize;
47     }
48 
getCentralDirectoryEntryCount()49     public int getCentralDirectoryEntryCount() {
50         return centralDirectoryEntryCount;
51     }
52 
getEocdOffset()53     public long getEocdOffset() {
54         return eocdOffset;
55     }
56 
getEocd()57     public ByteBuffer getEocd() {
58         return eocd;
59     }
60 }