Class FastZipEntry

java.lang.Object
nonapi.io.github.classgraph.fastzipfilereader.FastZipEntry
All Implemented Interfaces:
Comparable<FastZipEntry>

public class FastZipEntry extends Object implements Comparable<FastZipEntry>
A zip entry within a LogicalZipFile.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final long
    The compressed size of the zip entry, in bytes.
    final String
    The zip entry path.
    final String
    The unversioned entry name (i.e. entryName with "META_INF/versions/{versionInt}/" stripped)
    final int
    The file attributes for this resource, or 0 if unknown.
    final long
    The uncompressed size of the zip entry, in bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Sort in decreasing order of version number, then lexicographically increasing order of unversioned entry path.
    boolean
     
    long
    Get the last modified time in Epoch millis, or 0L if unknown.
    Get the path to this zip entry, using "!
    Lazily get zip entry slice -- this is deferred until zip entry data needs to be read, in order to avoid randomly seeking within zipfile for every entry as the central directory is read.
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • entryName

      public final String entryName
      The zip entry path.
    • compressedSize

      public final long compressedSize
      The compressed size of the zip entry, in bytes.
    • uncompressedSize

      public final long uncompressedSize
      The uncompressed size of the zip entry, in bytes.
    • fileAttributes

      public final int fileAttributes
      The file attributes for this resource, or 0 if unknown.
    • entryNameUnversioned

      public final String entryNameUnversioned
      The unversioned entry name (i.e. entryName with "META_INF/versions/{versionInt}/" stripped)
  • Method Details

    • getSlice

      public Slice getSlice() throws IOException
      Lazily get zip entry slice -- this is deferred until zip entry data needs to be read, in order to avoid randomly seeking within zipfile for every entry as the central directory is read.
      Returns:
      the offset within the physical zip file of the entry's start offset.
      Throws:
      IOException - If an I/O exception occurs.
    • getPath

      public String getPath()
      Get the path to this zip entry, using "!/" as a separator between the parent logical zipfile and the entry name.
      Returns:
      the path of the entry
    • getLastModifiedTimeMillis

      public long getLastModifiedTimeMillis()
      Get the last modified time in Epoch millis, or 0L if unknown.
      Returns:
      the last modified time in Epoch millis.
    • compareTo

      public int compareTo(FastZipEntry o)
      Sort in decreasing order of version number, then lexicographically increasing order of unversioned entry path.
      Specified by:
      compareTo in interface Comparable<FastZipEntry>
      Parameters:
      o - the object to compare to
      Returns:
      the result of comparison
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object