Record Class ZipEntryInfo
java.lang.Object
java.lang.Record
cloud.opencode.base.io.compress.ZipEntryInfo
- Record Components:
name- the entry name (path within the archive) | 条目名(归档内的路径)size- the uncompressed size in bytes, or -1 if unknown | 未压缩大小(字节),未知时为-1compressedSize- the compressed size in bytes, or -1 if unknown | 压缩后大小(字节),未知时为-1isDirectory- true if the entry is a directory | 如果条目是目录则为truecrc- the CRC-32 checksum, or -1 if unknown | CRC-32校验和,未知时为-1lastModified- the last modification time, or null if unknown | 最后修改时间,未知时为null
public record ZipEntryInfo(String name, long size, long compressedSize, boolean isDirectory, long crc, Instant lastModified)
extends Record
Zip Entry Metadata Record
Zip条目元数据记录
Immutable record holding metadata about a single entry within a Zip archive.
Used by ZipUtil.list(java.nio.file.Path) to report archive contents.
不可变记录,持有Zip归档中单个条目的元数据。
被ZipUtil.list(java.nio.file.Path)用于报告归档内容。
Features | 主要功能:
- Entry name, sizes, CRC, directory flag, timestamp - 条目名、大小、CRC、目录标志、时间戳
Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是(不可变记录)
- Since:
- JDK 25, opencode-base-io V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionZipEntryInfo(String name, long size, long compressedSize, boolean isDirectory, long crc, Instant lastModified) Creates an instance of aZipEntryInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecompressedSizerecord component.longcrc()Returns the value of thecrcrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisDirectoryrecord component.Returns the value of thelastModifiedrecord component.name()Returns the value of thenamerecord component.longsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ZipEntryInfo
public ZipEntryInfo(String name, long size, long compressedSize, boolean isDirectory, long crc, Instant lastModified) Creates an instance of aZipEntryInforecord class.- Parameters:
name- the value for thenamerecord componentsize- the value for thesizerecord componentcompressedSize- the value for thecompressedSizerecord componentisDirectory- the value for theisDirectoryrecord componentcrc- the value for thecrcrecord componentlastModified- the value for thelastModifiedrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
size
-
compressedSize
public long compressedSize()Returns the value of thecompressedSizerecord component.- Returns:
- the value of the
compressedSizerecord component
-
isDirectory
public boolean isDirectory()Returns the value of theisDirectoryrecord component.- Returns:
- the value of the
isDirectoryrecord component
-
crc
-
lastModified
Returns the value of thelastModifiedrecord component.- Returns:
- the value of the
lastModifiedrecord component
-