TrueZIP is a Java based virtual file system (VFS) implementation for transparent read/write access to archive files as if they were directories. Archive files may be arbitrarily nested and the nesting level is only limited by heap and file system size. TrueZIP's design strategy is to "make simple things easy and complex things possible".

For example, when using the default configuration, the instance new File("app.ear/web.war/WEB-INF/lib/lib.jar/META-INF/MANIFEST.MF") would refer to the text file entry META-INF/MANIFEST.MF within the JAR file entry WEB-INF/lib/lib.jar within the WAR file entry web.war within the EAR file app.ear. The same applies for any other supported and configured archive type.

Limitation: TrueZIP works on files only. If an archive is just available as an InputStream, it needs to be saved to a (temporary) file first. If this is not an option, TrueZIP can't be used.

TrueZIP provides a pluggable archive driver architecture to support virtually any archive type: Out of the box, TrueZIP supports ZIP, SFX/EXE, JAR, TZP, TAR, TAR.BZ2 and TAR.GZ. This list will be extended in future releases. Note that some of these archive types require additional JARs on the runtime class path.

To be minimal intrusive, TrueZIP provides drop-in replacements for many classes in the java.io package. This reduces the learning curve to the essential minimum and allows to introduce TrueZIP's functionality gradually within legacy applications or even other VFS solutions which are currently built on top of java.io.File*.

TrueZIP 6 requires only a J2SE 1.4.2 compatible Java Runtime Environment, but version 6.4 and later automatically benefit from new features available in JSE 5 and even JSE 6.

TrueZIP 6 is covered under the Apache License, Version 2.0.

Support

Please subscribe to the user mailing list via users-subscribe@truezip.dev.java.net to get support and feel free to tell me what you think about TrueZIP. I'm always interested in your opinion, be it good or bad! But read on first, please.

Default Configuration

In TrueZIP 6.5, the following archive types and access parameters are defined by the default configuration resource file in truezip.jar/META-INF/services/de.schlichtherle.io.ArchiveDriverRegistry.properties. Note that only the archive file suffixes "ear|jar|war|zip" are recognized in file paths by default.

Type

Canonical Suffixes0

DEFAULT1

ALL2

Charset3

Dependencies4

Description

ZIP

zip

Yes

Yes

IBM4375

 

ZIP32 file: Archive file with central directory and compressible entries

JAR

ear|jar|war

Yes

Yes

UTF-8

 

Java Archive: ZIP32 with custom directory tree layout

ODF odb|odf|odg|odm|odp|ods|odt|otg|oth|otp|ots|ott No Yes UTF-8   OpenDocument Format: If present, the mimetype entry is written first with STORED method.
TZP

tzp|zip.rae|zip.raes

No

Yes

UTF-8

lcrypto.jar6

RAES encrypted ZIP32 file.

SFX/EXE

exe

No

Yes

system specific

 

ZIP32 file with a code preamble for self extraction. This driver is pretty slow.

TAR

tar

No

Yes

US-ASCII7

ant.jar8

TAR: Uncompressed tape archive file.

TAR.BZ2

tbz2|tar.bz2

No

Yes

US-ASCII7

ant.jar8

TAR file wrapped in BZIP2 compression format.

TAR.GZ

tar.gz|tgz

No

Yes

US-ASCII7

ant.jar8

TAR file wrapped in GZIP compression format.

0 Suffix recognition is case insensitive with the {@link de.schlichtherle.io.DefaultArchiveDetector} class.
1 Recognized by the predefined instance {@link de.schlichtherle.io.ArchiveDetector#DEFAULT}? Note that this may be extended (but not restricted) in future releases.
2 Recognized by the predefined instance {@link de.schlichtherle.io.ArchiveDetector#ALL}? Note that this may be extended (but not restricted) in future releases.
3 The code page to use for entry names and other entry meta data. This access parameter is determined by the archive driver (not the archive detector) and can be customized by subclassing it.
4 This needs to be on the runtime class path.
5 The charset for ZIP files is not specified. This is a heuristic value which is based on the fact that IBM437 is the original PC character set for the USA and the ZIP file format has been invented there. Do not rely on this!
6 Bouncy Castle's Lightweight Crypto API for JDK 1.4, version 1.30 or higher. Available at http://www.bouncycastle.org/latest_releases.html.
7 The charset for TAR files is not specified. This is a heuristic value which is based on the fact that the TAR file format stems from UNIX implementations of the seventies.
8 Apache's Ant, version 1.6.5 or higher. Version 1.7.0 is recommended for enhanced performance and stability and is required for BZIP2 compression. Available at http://ant.apache.org.