Class ZipFileSlice
java.lang.Object
nonapi.io.github.classgraph.fastzipfilereader.ZipFileSlice
- Direct Known Subclasses:
LogicalZipFile
A zipfile slice (a sub-range of bytes within a PhysicalZipFile.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ZipFileSliceThe parent slice, or null if this is the toplevel slice (the whole zipfile).private final StringFor the toplevel zipfile slice, the zipfile path; For nested slices, the name/path of the zipfile entry.protected final PhysicalZipFileThe underlying physical zipfile.TheSlicecontaining the zipfile. -
Constructor Summary
ConstructorsConstructorDescriptionZipFileSlice(FastZipEntry zipEntry) Create a ZipFileSlice that wraps a single stored (not deflated)FastZipEntry.ZipFileSlice(PhysicalZipFile physicalZipFile) Create a ZipFileSlice that wraps a toplevelPhysicalZipFile.ZipFileSlice(PhysicalZipFile physicalZipFile, FastZipEntry zipEntry) Create a ZipFileSlice that wraps aPhysicalZipFilethat was extracted or inflated from a nested jar to memory or disk.ZipFileSlice(ZipFileSlice other) Clone constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidappendPath(StringBuilder buf) Recursively append the path in top down ancestral order.booleanGet the parent ZipFileslice, or return null if this is a toplevel slice (i.e.getPath()Get the path of this zipfile slice, e.g.Get the name of the slice (either the entry name/path within the parent zipfile slice, or the path of the physical zipfile if this slice is a toplevel slice (i.e.Get the physicalFilethat this ZipFileSlice is a slice of.inthashCode()booleanisAcceptedAndNotRejected(AcceptReject.AcceptRejectLeafname jarAcceptReject) Check whether this zipfile slice and all of its parent slices are accepted and not rejected in the jarfile accept/reject criteria.toString()
-
Field Details
-
parentZipFileSlice
The parent slice, or null if this is the toplevel slice (the whole zipfile). -
physicalZipFile
The underlying physical zipfile. -
pathWithinParentZipFileSlice
For the toplevel zipfile slice, the zipfile path; For nested slices, the name/path of the zipfile entry. -
slice
-
-
Constructor Details
-
ZipFileSlice
ZipFileSlice(PhysicalZipFile physicalZipFile) Create a ZipFileSlice that wraps a toplevelPhysicalZipFile.- Parameters:
physicalZipFile- the physical zipfile
-
ZipFileSlice
ZipFileSlice(PhysicalZipFile physicalZipFile, FastZipEntry zipEntry) Create a ZipFileSlice that wraps aPhysicalZipFilethat was extracted or inflated from a nested jar to memory or disk.- Parameters:
physicalZipFile- a physical zipfile that has been extracted to RAMzipEntry- the zip entry
-
ZipFileSlice
ZipFileSlice(FastZipEntry zipEntry) throws IOException, InterruptedException Create a ZipFileSlice that wraps a single stored (not deflated)FastZipEntry.- Parameters:
zipEntry- the zip entry- Throws:
IOException- If an I/O exception occurs.InterruptedException- If the thread was interrupted.
-
ZipFileSlice
-
-
Method Details
-
isAcceptedAndNotRejected
Check whether this zipfile slice and all of its parent slices are accepted and not rejected in the jarfile accept/reject criteria.- Parameters:
jarAcceptReject- the jar accept/reject criteria- Returns:
- true if this zipfile slice and all of its parent slices are accepted and not rejected in the jarfile accept/reject criteria.
-
getParentZipFileSlice
Get the parent ZipFileslice, or return null if this is a toplevel slice (i.e. if this slice wraps an entire physical zipfile).- Returns:
- the parent ZipFileslice, or null if this is a toplevel slice.
-
getPathWithinParentZipFileSlice
Get the name of the slice (either the entry name/path within the parent zipfile slice, or the path of the physical zipfile if this slice is a toplevel slice (i.e. if this slice wraps an entire physical zipfile).- Returns:
- the name of the slice.
-
appendPath
Recursively append the path in top down ancestral order.- Parameters:
buf- the buf to append the path to
-
getPath
Get the path of this zipfile slice, e.g. "/path/to/jarfile.jar!/nestedjar1.jar".- Returns:
- the path of this zipfile slice.
-
getPhysicalFile
-
equals
-
hashCode
-
toString
-