@Immutable @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public class ZipDriver extends FsCharsetArchiveDriver<ZipArchiveEntry> implements ZipEntryFactory<ZipArchiveEntry>
JarDriver instead!
This driver does not check the CRC value of any entries in existing
archives
- use CheckedZipDriver instead!
CheckedZipDriver| Modifier and Type | Field and Description |
|---|---|
private IOPoolProvider |
provider |
private static Charset |
ZIP_CHARSET
The default character set for entry names and comments, which is
"IBM437". |
| Modifier | Constructor and Description |
|---|---|
|
ZipDriver(IOPoolProvider provider)
Equivalent to
new ZipDriver(provider, ZIP_CHARSET). |
protected |
ZipDriver(IOPoolProvider provider,
Charset charset)
Constructs a new ZIP driver.
|
assertEncodable, getCharset, toString, toZipOrTarEntryNamegetClosedIcon, getInputSocket, getOpenIcon, isFederated, newController, newEntry, newInputStream, newOutputStream, newReadOnlyFilegetPriorityprivate static final Charset ZIP_CHARSET
"IBM437".private final IOPoolProvider provider
public ZipDriver(IOPoolProvider provider)
new ZipDriver(provider, ZIP_CHARSET).protected ZipDriver(IOPoolProvider provider, Charset charset)
provider - the I/O pool service to use for allocating temporary I/O
entries.charset - the character set to use for entry names and comments.protected final IOPool<?> getPool()
getPool in class FsArchiveDriver<ZipArchiveEntry>public boolean getPreambled()
preambled.
If this is true, then a ZIP file is allowed to contain arbitrary
data as its preamble before the actual ZIP file data.
Self Extracting Archives typically use a preamble to store the
application code that is required to extract the ZIP file contents.
Note that searching for a preamble can seriously degrade the performance if the file is not compatible to the ZIP File Format Specification.
The implementation in the class ZipDriver returns false.
preambled.public boolean getPostambled()
postambled.
If this is true, then a ZIP file is allowed to contain arbitrary
length data as its postamble after the actual ZIP file data.
If this is false, then a ZIP file may still have a postamble.
However, the postamble must not exceed 64KB size, including the End Of
Central Directory record and thus the ZIP file comment.
This causes the initial ZIP file compatibility test to fail fast if the
file is not compatible to the ZIP File Format Specification.
Note that searching for an arbitrary length postamble can seriously
degrade the performance if the file is not compatible to the ZIP File
Format Specification.
So this should be set to true only if Self Extracting Archives
with very large postambles need to get supported.
The implementation in the class ZipDriver returns false.
postambled.public int getMethod()
method.
This is the compression method to use when writing an entry to a ZIP
output stream.
The implementation in the class ZipDriver returns
ZipEntry.DEFLATED.
method.public int getLevel()
level.
This is the compression level to use when deflating an entry to a ZIP
output stream.
The implementation in the class ZipDriver returns
Deflater.BEST_COMPRESSION.
level.public OutputSocket<?> getOutputSocket(FsController<?> controller, FsEntryName name, BitField<FsOutputOption> options, @CheckForNull Entry template)
getOutputSocket in class FsArchiveDriver<ZipArchiveEntry>public ZipArchiveEntry newEntry(String name, Entry.Type type, Entry template, BitField<FsOutputOption> mknod) throws CharConversionException
newEntry in class FsArchiveDriver<ZipArchiveEntry>CharConversionExceptionpublic ZipArchiveEntry newEntry(String name)
ZipEntryFactoryname.newEntry in interface ZipEntryFactory<ZipArchiveEntry>name - the entry name - null is not permitted.name.public ZipArchiveEntry newEntry(String name, ZipArchiveEntry template)
public ZipInputShop newInputShop(FsModel model, InputSocket<?> input) throws IOException
The implementation in the class ZipDriver acquires a read only
file from the given socket and forwards the call to
newZipInputShop(de.schlichtherle.truezip.fs.FsModel, de.schlichtherle.truezip.rof.ReadOnlyFile).
newInputShop in class FsArchiveDriver<ZipArchiveEntry>IOExceptionprotected ZipInputShop newZipInputShop(FsModel model, ReadOnlyFile rof) throws IOException
IOExceptionpublic OutputShop<ZipArchiveEntry> newOutputShop(FsModel model, OutputSocket<?> output, @CheckForNull InputShop<ZipArchiveEntry> source) throws IOException
The implementation in ZipDriver simply forwards the call to
newZipOutputShop(de.schlichtherle.truezip.fs.FsModel, java.io.OutputStream, de.schlichtherle.truezip.fs.archive.zip.ZipInputShop) and wraps the result in a new
FsMultiplexedArchiveOutputShop.
newOutputShop in class FsArchiveDriver<ZipArchiveEntry>IOExceptionprotected ZipOutputShop newZipOutputShop(FsModel model, OutputStream out, @CheckForNull ZipInputShop source) throws IOException
IOExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.