TrueZIP is a Java based virtual file system (VFS) which enables client applications to perform CRUD (Create, Read, Update, Delete) operations on archive files as if they were virtual directories, even with nested archive files in multithreaded environments - see Key Features. With TrueZIP, creating a TAR.GZ file from a ZIP file is as easy as calling:
new TFile("archive.zip").cp_rp(new TFile("archive.tar.gz"));
As of TrueZIP 7.7.7, this project has changed into maintenance mode: Bugs will still be fixed in new incremental version releases, but all enhancements and new features will only go into TrueVFS, the official successor to this project, instead.
TrueZIP ships with the following pluggable file system driver modules:
|TrueZIP Driver FILE||Provides read/write access to the platform file system. Automatically uses NIO.2 if JSE 7 is available.|
|TrueZIP Driver HTTP(S)||Provides read-only access to HTTP(S) URLs.|
|TrueZIP Driver TAR||Provides read/write access to TAR, TAR.BZ2, TAR.GZ and TAR.XZ files.|
|TrueZIP Driver ZIP||Provides read/write access to ZIP, JAR, EAR, WAR etc. Supports appending to existing ZIP files, recovery of lost ZIP entries, WinZip AES encryption, BZIP2 compression, selectable character sets, external file attributes and ZIP64 extensions.|
|TrueZIP Driver ZIP.RAES (TZP)||Provides read/write access to JAR files which are entirely wrapped in an envelope with AES-256/CTR encryption, SHA-256 authentication and PKCS #12 V1 PBKDF.|
Add the JAR artifact of these modules to the run time class path to make their file system drivers available for service location in the client API modules - see below.
As a library, TrueZIP provides simple, uniform, transparent, thread-safe, read/write access to archive files as if they were virtual directories in a file system path. Starting with TrueZIP 7.2, there are two client API modules available which can get used concurrently to access the same (virtual) file systems:
|TrueZIP File*||JSE 6||Provides classes which can get used in exactly the same way as the java.io.File* classes, so it's easy to learn or migrate an existing application. In addition, easy to use, yet powerful methods for standard tasks like file or directory tree copying, moving, deleting, traversing etc are provided, too.|
|TrueZIP Path||JSE 7||Provides classes which implement a java.nio.file.spi.FileSystemProvider for the NIO.2 API (JSR 203) to enable an application to access archive files within any (virtual) file system, e.g. via HTTP(S). Applications can even read or write archive entries in random order using a SeekableByteChannel.|
Writing an application for either API is really easy: Please have a look at the page Getting Started to learn how to generate a TrueZIP client application from a Maven archetype in about ten minutes.
As a framework, TrueZIP provides the interfaces and classes to write file system drivers which plug-in to its federated file system space. The module TrueZIP Kernel provides federating, multithreading, multiplexing, caching and accounting so that archive file system drivers do not need to take care of these aspects of a virtual file system.
There is no tutorial for how to write a file system driver, but there's comprehensive Javadoc and sample code:
- If you are going to write a federated file system driver (i.e. archive driver), please consult the Javadoc for de.schlichtherle.truezip.fs.archive.FsArchiveDriver.
- If you are going to write a non-federated file system driver, please consult the Javadoc for de.schlichtherle.truezip.fs.FsDriver.
For sample code, please check out or download the source code of this project and consult the file system driver implementations which ship with TrueZIP, e.g. TrueZIP Driver FILE or TrueZIP Driver ZIP.