Class ZipArchiveReader.Builder
- java.lang.Object
-
- kala.compress.archivers.ArchiveReaderBuilder<ZipArchiveReader,ZipArchiveReader.Builder>
-
- kala.compress.archivers.zip.ZipArchiveReader.Builder
-
- Enclosing class:
- ZipArchiveReader
public static class ZipArchiveReader.Builder extends ArchiveReaderBuilder<ZipArchiveReader,ZipArchiveReader.Builder>
Builds newZipArchiveReaderinstances.The channel will be opened for reading, assuming the specified encoding for file names.
See
SeekableInMemoryByteChannelto read from an in-memory archive.By default the central directory record and all local file headers of the archive will be read immediately which may take a considerable amount of time when the archive is big. The
ignoreLocalFileHeaderparameter can be set totruewhich restricts parsing to the central directory. Unfortunately the local file header may contain information not present inside of the central directory which will not be available when the argument is set totrue. This includes the content of the Unicode extra field, so settingignoreLocalFileHeadertotruemeansuseUnicodeExtraFieldswill be ignored effectively.- Since:
- 1.26.0
-
-
Field Summary
Fields Modifier and Type Field Description private booleanignoreLocalFileHeaderprivate longmaxNumberOfDisksprivate booleanuseUnicodeExtraFields-
Fields inherited from class kala.compress.archivers.ArchiveReaderBuilder
charset, DEFAULT_OPEN_OPTIONS, openOptions, originDescription, path, seekableByteChannel
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZipArchiveReaderget()Gets the archive reader.ZipArchiveReader.BuildersetIgnoreLocalFileHeader(boolean ignoreLocalFileHeader)Sets whether to ignore information stored inside the local file header.ZipArchiveReader.BuildersetMaxNumberOfDisks(long maxNumberOfDisks)Sets max number of multi archive disks, default is 1 (no multi archive).ZipArchiveReader.BuildersetUseUnicodeExtraFields(boolean useUnicodeExtraFields)Sets whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.-
Methods inherited from class kala.compress.archivers.ArchiveReaderBuilder
asThis, checkPath, setByteArray, setCharset, setCharset, setFile, setFile, setOpenOptions, setOriginDescription, setPath, setPath, setSeekableByteChannel, setURI
-
-
-
-
Method Detail
-
get
public ZipArchiveReader get() throws java.io.IOException
Description copied from class:ArchiveReaderBuilderGets the archive reader.- Specified by:
getin classArchiveReaderBuilder<ZipArchiveReader,ZipArchiveReader.Builder>- Returns:
- a result.
- Throws:
java.io.IOException- if an I/O error occurs.
-
setIgnoreLocalFileHeader
public ZipArchiveReader.Builder setIgnoreLocalFileHeader(boolean ignoreLocalFileHeader)
Sets whether to ignore information stored inside the local file header.- Parameters:
ignoreLocalFileHeader- whether to ignore information stored inside.- Returns:
thisinstance.
-
setMaxNumberOfDisks
public ZipArchiveReader.Builder setMaxNumberOfDisks(long maxNumberOfDisks)
Sets max number of multi archive disks, default is 1 (no multi archive).- Parameters:
maxNumberOfDisks- max number of multi archive disks.- Returns:
thisinstance.
-
setUseUnicodeExtraFields
public ZipArchiveReader.Builder setUseUnicodeExtraFields(boolean useUnicodeExtraFields)
Sets whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.- Parameters:
useUnicodeExtraFields- whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.- Returns:
thisinstance.
-
-