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 | 未压缩大小(字节),未知时为-1
compressedSize - the compressed size in bytes, or -1 if unknown | 压缩后大小(字节),未知时为-1
isDirectory - true if the entry is a directory | 如果条目是目录则为true
crc - the CRC-32 checksum, or -1 if unknown | CRC-32校验和,未知时为-1
lastModified - 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 Details

    • ZipEntryInfo

      public ZipEntryInfo(String name, long size, long compressedSize, boolean isDirectory, long crc, Instant lastModified)
      Creates an instance of a ZipEntryInfo record class.
      Parameters:
      name - the value for the name record component
      size - the value for the size record component
      compressedSize - the value for the compressedSize record component
      isDirectory - the value for the isDirectory record component
      crc - the value for the crc record component
      lastModified - the value for the lastModified record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • size

      public long size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • compressedSize

      public long compressedSize()
      Returns the value of the compressedSize record component.
      Returns:
      the value of the compressedSize record component
    • isDirectory

      public boolean isDirectory()
      Returns the value of the isDirectory record component.
      Returns:
      the value of the isDirectory record component
    • crc

      public long crc()
      Returns the value of the crc record component.
      Returns:
      the value of the crc record component
    • lastModified

      public Instant lastModified()
      Returns the value of the lastModified record component.
      Returns:
      the value of the lastModified record component