[jbosstools-dev] JBIDE-2311 and Archives

Rob Stryker rob.stryker at redhat.com
Mon Jun 9 19:00:50 EDT 2008


I thought I'd update on the state of archives as it relates to all these 
pesky NPE's floating around.

This one actually wasn't caused by my poor VFS, but rather by the 
underlying library (truezip) and their VFS.
Basically, without doing a huge deep deep dive into TrueZip, it seems 
very difficult to successfully ensure
that, once inside an archive, you can be sure that some elements are 
treated as files and others as internal archives.

I've fixed the bug, 2311, without regressing on jbide-2290 by checking 
first if the destination is inside something that's
already zipped up. If it is, then I use a default "archive detector" to 
determine if my file is a nested zip or an exploded
file inside a zip.

The long and the short of it is that, without a much more in-depth model 
/ xml file, there's going to be a
difficult time with the use case shown below:

/project
|-dest
   |- zipped.war
       |- unzipped.jar
            |- someFile.txt
|- src
   |- zipped.war (just a folder)
       |- unzipped.jar (also a folder)
            |- someFile.txt (plain file)

fileset:  /src/** -> /dest/zipped.war exploded=false

In the above example, with the current code (post-patch), it is almost 
guaranteed that unzipped.jar
will actually be zipped because the fileset itself does not give any 
advice on what to do with other
elements below it that may have extensions that want to be zipped.

I've got the unit tests in and a patch that fixes the two most egregious 
problems (jbide-2311 and jbide-2290).
This issue has not been complained about yet by anyone, but I can 
already tell it will be a problem.
I'll try to make a unit test for that next.

- Rob Stryker



More information about the jbosstools-dev mailing list