@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) class DefaultZipFileParameters extends DefaultZipCharsetParameters implements ZipFileParameters<ZipEntry>
ZipFileParameters.| Modifier and Type | Field and Description |
|---|---|
private boolean |
postambled |
private boolean |
preambled |
| Constructor and Description |
|---|
DefaultZipFileParameters(Charset charset,
boolean preambled,
boolean postambled) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getPostambled()
Returns the flag for allowing a postamble of arbitrary length.
|
boolean |
getPreambled()
Returns the flag for allowing a preamble.
|
ZipEntry |
newEntry(String name)
Returns a new ZIP entry with the given
name. |
getCharsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCharsetDefaultZipFileParameters(Charset charset, boolean preambled, boolean postambled)
public boolean getPostambled()
ZipFileParameters
If this method returns true, then a ZIP file is allowed to
contain arbitrary data of arbitrary length as its postamble after the
actual ZIP file data.
Note that searching for an arbitrary length postamble can seriously
degrade the performance when reading a false positive ZIP file, i.e.
an arbitrary file which not compatible to the ZIP File Format
Specification, because then the entire file needs to get searched for
an End Of Central Directory Record (EOCDR) signature.
So this should only be used if self extracting ZIP files with very large
postambles need to get supported.
If this method returns false, then a ZIP file may still have a
postamble, but it must not exceed 64KB size, including the End Of
Central Directory record with the ZIP file comment.
This causes the reading of a false positive ZIP file to fail fast.
getPostambled in interface ZipFileParameters<ZipEntry>public boolean getPreambled()
ZipFileParameters
If this method returns 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.
If this method returns false, the a ZIP file must start with
either a Local File Header (LFH) signature,
a ZIP64 End Of Central Directory Record (EOCDR) signature or an End Of
Central Directory Record (EOCDR) signature.
getPreambled in interface ZipFileParameters<ZipEntry>public ZipEntry newEntry(String name)
ZipEntryFactoryname.newEntry in interface ZipEntryFactory<ZipEntry>name - the entry name.name.Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.