Home > Maven > TrueZip – Not only annoying but buggy as well!

TrueZip – Not only annoying but buggy as well!

It appears TrueZip is not only unnecessary complex and annoying to use (to say the least..) – but it’s very buggy as well (at least, version 6.6 that is available through repo1) :( 

Now, I wouldn’t mind for any other library to have some bugs here and there – everyone’s code has them, of course. But this one was getting on my nerve for a long time already. I bet it was someone’s university project: all this unnecessary complexity, all this amateur API with tons of duplicate methods doing almost the same .. I mean, just viewing a ZIP file as a “virtual file system” – doesn’t it look like someone’s thesis to you ?! Come one, people usually pack and unpack them, you know. With occasional updates which I think are so rare that it’s much simpler to unpack the archive to temporal folder and pack it back (which is already happening behind the scenes anyway – see below)

Some things that I’ve discovered lately:

  1. If you pack a folder that contains other ZIP archives (I had to pack a folder with two big ZIPs inside, each one a JDK distribution) – the library seems to be repacking them!

    Why ? 

    – I don’t know. Probably because it’s so smart thing to do.

    But how do I know that ?

    Size of (supposedly repacked) ZIP files is changing – it is dropping down a bit inside new archive
    – There are lot’s of “tzp-ctrl.tmp” files created in my temp folder during the process
    – New  archives do not open on Linux any more but only on Windows

  2. Build process can’t be terminated when “pack” is in process – it can only be done by killing “java.exe”. So sweet.

  3. There were many times when TrueZip Maven plugin  silently did nothing and created no archive when <includes> were involved (which I re-checked many times, of course, but I won’t be surprised if TrueZip has it’s own logic for how <include> works, like where it’s base directory and the like). So I had to pack the whole folder without <includes> and then remove the files that I didn’t want. Yes, it is silly, no doubt about that.

    And, btw, I really don’t like when things go wrong silently (which is a plague in some projects – Ant and Velocity are first coming to mind, you have an undefined property but those two ignore it silently).

    Hey, TrueZip! If for some reason I have wrong <include> patterns (which I’m sure were correct, but .. nevermind) and no archive is actually created – why being so silent about that ? In my code an exception is thrown when a combination of include and exclude patterns returns an empty Collection (and exception is specifying all three: base directory, include patterns, exclude patterns). 

  4. Not a bug but a pure headache: things go really wrong if you forget to make this umount() call after creating an archive. Like clicking an “Ok” button – it flushes all data to disk. There’s also an update() call as well but it “may retain some temporary files” (surprise, surprise!) so one shouldn’t really call it (which I did until noticed this subtle difference)

I do hope I won’t have to post about this library again.

Advertisements
Categories: Maven Tags: ,
  1. August 16, 2009 at 22:37

    Another TrueZip brilliance – one can’t modify at run-time it’s registry of installed drivers (archives handlers). It is locked in and read only after system starts up. Why, oh why ?!! I had to provide “resources/META-INF/services/de.schlichtherle.io.registry.properties” in the classpath in order to specify that some custom “.xyz” file extension is, in fact, a usual ZIP file. What a pain, why there’s no way to do so in a run-time ? Btw, version 6.6 that is available through Maven was released on April 3rd, 2007. Latest available 6.7 beta2 version was released on January 24, 2008, a year and a half ago. It’s pity this library is abandoned – it has lot’s to fix …

    • August 16, 2009 at 22:47

      Ah, forgot to add, that when TrueZip is asked to unpack a file with unknown (to it) extension – it, yes, yes, you’ve guessed it right! Silently Does Nothing. So sweet, part II.

  1. August 16, 2009 at 21:39

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: