public static class ZipFile.Builder extends AbstractStreamBuilder<ZipFile,ZipFile.Builder>
ZipFile instances.
The channel will be opened for reading, assuming the specified encoding for file names.
See SeekableInMemoryByteChannel to 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 ignoreLocalFileHeader parameter can be set to true which 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 to true. This includes the content of the Unicode extra field, so setting ignoreLocalFileHeader to true means useUnicodeExtraFields will be ignored effectively.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
ZipFile |
get()
Gets a result.
|
ZipFile.Builder |
setIgnoreLocalFileHeader(boolean ignoreLocalFileHeader)
Sets whether to ignore information stored inside the local file header.
|
ZipFile.Builder |
setMaxNumberOfDisks(long maxNumberOfDisks)
Sets max number of multi archive disks, default is 1 (no multi archive).
|
ZipFile.Builder |
setSeekableByteChannel(java.nio.channels.SeekableByteChannel seekableByteChannel)
The actual channel, overrides any other input aspects like a File, Path, and so on.
|
ZipFile.Builder |
setUseUnicodeExtraFields(boolean useUnicodeExtraFields)
Sets whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.
|
getCharset, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeMax, setCharset, setCharset, setOpenOptionssetByteArray, setCharSequence, setFile, setFile, setInputStream, setOutputStream, setPath, setPath, setReader, setURI, setWriterequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplierpublic ZipFile get() throws java.io.IOException
IOSupplierjava.io.IOException - if an I/O error occurs.public ZipFile.Builder setIgnoreLocalFileHeader(boolean ignoreLocalFileHeader)
ignoreLocalFileHeader - whether to ignore information stored inside.public ZipFile.Builder setMaxNumberOfDisks(long maxNumberOfDisks)
maxNumberOfDisks - max number of multi archive disks.public ZipFile.Builder setSeekableByteChannel(java.nio.channels.SeekableByteChannel seekableByteChannel)
seekableByteChannel - The actual channel.public ZipFile.Builder setUseUnicodeExtraFields(boolean useUnicodeExtraFields)
useUnicodeExtraFields - whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.Copyright © 2010 - 2024 Adobe. All Rights Reserved