Ruminations aside, I'd not heard of TrueZip before and would have skipped the page but for the nice one page howto on using it that made me realize that it was the perfect fit for one of the java projects I'd been working on
What was needed was a way to read/delete/modify archive contents (primarily zip). The challenge was that the archive contained multiple files within a directory hierarchy and all that was needed to do was modify one of them. Something like this.
So the target here is trying to read/write to the Config.xml file inside Folder1\Conf.
Java provides handy java.util.zip package for handling zip files but the architecture can be more or less awkward. After traversing the maze of javadocs and googling around, you'd somehow build a decent reader class but writing out modifications is a pain area.
Thats where TrueZip comes in. It acts as a Virtual File System allowing you to read/write your archive(zip) contents just as you would using normal File System classes in Java ( InputStream, Reader, Writer etc).
So for the former example all you need to do for reading and writing is open the corresponding reader/writer to this resource "Archive.zip\Folder1\Conf\config.xml"
Ah so simple. Isn't that what a good framework is supposed to do. Simplify things without building up additional complexity. And TrueZip does that with no extra brouhaha - no xml bloat, nor wiring of dependencies. Just a plain simple library solving a missing feature in the Java distribution. And it comes free under an "Apache2.0" license.
Thank you very much for blogging about TrueZIP.
ReplyDeleteGreetz from its author.
Thanks for writing such a cool piece of software & making it available for all ;-)
ReplyDelete