xref: /aosp_15_r20/external/okio/okio/src/jvmMain/kotlin/okio/internal/ZipEntry.kt (revision f9742813c14b702d71392179818a9e591da8620c)
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 package okio.internal
18 
19 import okio.Path
20 
21 internal class ZipEntry(
22   /**
23    * Absolute path of this entry. If the raw name on disk contains relative paths like `..`, they
24    * are not present in this path.
25    */
26   val canonicalPath: Path,
27 
28   /** True if this entry is a directory. When encoded directory entries' names end with `/`. */
29   val isDirectory: Boolean = false,
30 
31   /** The comment on this entry. Empty if there is no comment. */
32   val comment: String = "",
33 
34   /** The CRC32 of the uncompressed data, or -1 if not set. */
35   val crc: Long = -1L,
36 
37   /** The compressed size in bytes, or -1 if unknown. */
38   val compressedSize: Long = -1L,
39 
40   /** The uncompressed size in bytes, or -1 if unknown. */
41   val size: Long = -1L,
42 
43   /** Either [COMPRESSION_METHOD_DEFLATED] or [COMPRESSION_METHOD_STORED]. */
44   val compressionMethod: Int = -1,
45 
46   val lastModifiedAtMillis: Long? = null,
47 
48   val offset: Long = -1L,
49 ) {
50   val children = mutableListOf<Path>()
51 }
52