The all-in-one JAR saves you from grabbing the module JARs individually. However, as the name implies, it includes all sample code which bloats the code size of the application. More importantly, this will also initially set up the TrueZIP File* API to detect all canonical file suffixes of all supported archive file types in TrueZIP 7.7.9 - see the table at the end of this page. This may produce some unwanted side effects on an unintended access to an archive file:
- The virtual file system of an archive file is automatically mounted.
- This may confuse the application because the archive file unexpectedly behaves like a directory instead of a file.
- In case of TAR files, this can be considerably slow because this file format doesn't provide a central directory and thus the driver will unpack the entire TAR file into a temporary directory first.
- In case of a plain EXE file, an attempt is made to locate the central directory of a self extracting ZIP file which will cause the entire file to be read.
- A Swing or console based dialog prompts the user for a password to access a RAES encrypted ZIP file.
To avoid these unwanted side effects, you should always configure the TrueZIP File* API to detect exactly only the file suffixes of the archive types required to access. Here is a sample available for this task. For further information, please refer to the Javadoc for the class TArchiveDetector.
Following are the canonical archive file suffixes which will be detected by an application using the TrueZIP File* API according to the initial set up of the all-in-one JAR truezip-samples-7.7.9-jar-with-dependencies.jar:
|Canonical File Suffixes||File System Driver Class|
|ear, jar, war||JarDriver|
|odt, ott, odg, otg, odp, otp, ods, ots, odc, otc, odi, oti, odf, otf, odm, oth, odb||OdfDriver|
|tar.bz2, tb2, tbz||TarBZip2Driver|
|tzp, zip.rae, zip.raes||SafeZipRaesDriver|