Class PhysicalZipFile
java.lang.Object
nonapi.io.github.classgraph.fastzipfilereader.PhysicalZipFile
A physical zipfile, which is mmap'd using a
FileChannel.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileTheFilebacking thisPhysicalZipFile, if any.private intThe cached hashCode.(package private) NestedJarHandlerThe nested jar handler.private PathThePathbacking thisPhysicalZipFile, if any.private final StringThe path to the zipfile.(package private) SliceTheSlicefor the zipfile. -
Constructor Summary
ConstructorsConstructorDescriptionPhysicalZipFile(byte[] arr, File outermostFile, String pathStr, NestedJarHandler nestedJarHandler) Construct aPhysicalZipFilefrom a byte array.PhysicalZipFile(File file, NestedJarHandler nestedJarHandler, LogNode log) Construct aPhysicalZipFilefrom a file on disk.PhysicalZipFile(InputStream inputStream, long inputStreamLengthHint, String pathStr, NestedJarHandler nestedJarHandler, LogNode log) Construct aPhysicalZipFileby reading from theInputStreamto an array in RAM, or spill to disk if theInputStreamis too long.PhysicalZipFile(Path path, NestedJarHandler nestedJarHandler, LogNode log) Construct aPhysicalZipFilefrom aPath. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetFile()Get theFilefor the outermost jar file of this PhysicalZipFile.getPath()Get thePathfor the outermost jar file of this PhysicalZipFile.Get the path for this PhysicalZipFile, which is the file path, if it is file-backed, or a compound nested jar path, if it is memory-backed.inthashCode()longlength()Get the length of the mapped file, or the initial remaining bytes in the wrapped ByteBuffer if a buffer was wrapped.toString()
-
Field Details
-
path
ThePathbacking thisPhysicalZipFile, if any. -
file
TheFilebacking thisPhysicalZipFile, if any. -
pathStr
The path to the zipfile. -
slice
-
nestedJarHandler
NestedJarHandler nestedJarHandlerThe nested jar handler. -
hashCode
private int hashCodeThe cached hashCode.
-
-
Constructor Details
-
PhysicalZipFile
PhysicalZipFile(File file, NestedJarHandler nestedJarHandler, LogNode log) throws IOException Construct aPhysicalZipFilefrom a file on disk.- Parameters:
file- the filenestedJarHandler- the nested jar handlerlog- the log- Throws:
IOException- if an I/O exception occurs.
-
PhysicalZipFile
PhysicalZipFile(Path path, NestedJarHandler nestedJarHandler, LogNode log) throws IOException Construct aPhysicalZipFilefrom aPath.- Parameters:
path- the pathnestedJarHandler- the nested jar handlerlog- the log- Throws:
IOException- if an I/O exception occurs.
-
PhysicalZipFile
PhysicalZipFile(byte[] arr, File outermostFile, String pathStr, NestedJarHandler nestedJarHandler) throws IOException Construct aPhysicalZipFilefrom a byte array.- Parameters:
arr- the array containing the zipfile.outermostFile- the outermost filepathStr- the pathnestedJarHandler- the nested jar handler- Throws:
IOException- if an I/O exception occurs.
-
PhysicalZipFile
PhysicalZipFile(InputStream inputStream, long inputStreamLengthHint, String pathStr, NestedJarHandler nestedJarHandler, LogNode log) throws IOException Construct aPhysicalZipFileby reading from theInputStreamto an array in RAM, or spill to disk if theInputStreamis too long.- Parameters:
inputStream- the input streaminputStreamLengthHint- The number of bytes to read in inputStream, or -1 if unknown.pathStr- the source URL the InputStream was opened from, or the zip entry path of this entry in the parent zipfilenestedJarHandler- the nested jar handlerlog- the log- Throws:
IOException- if an I/O exception occurs.
-
-
Method Details
-
getPath
-
getFile
-
getPathStr
Get the path for this PhysicalZipFile, which is the file path, if it is file-backed, or a compound nested jar path, if it is memory-backed.- Returns:
- the path for this PhysicalZipFile, which is the file path, if it is file-backed, or a compound nested jar path, if it is memory-backed.
-
length
public long length()Get the length of the mapped file, or the initial remaining bytes in the wrapped ByteBuffer if a buffer was wrapped.- Returns:
- the length of the mapped file
-
hashCode
-
equals
-
toString
-