Menu

#14 handle Zip/Jar files as input - much like a directory

Next_Release
open
5
2010-06-19
2008-05-27
Jerry Regan
No

It appears that to calculate a sum/hash on the components inside a jar/zipfile, one must first explode the jar/zip, then calculate the desired value.

While that's not a huge burden, it seems to me that using Java's zip/jar API, one could traverse the file to calculate the desired value(s) without exploding the jar/zip. That avoids all the steps (explode to temp dir, calc sum, cleanup temp dir) otherwise required to determine exactly which components of a jar/zip have changed.

I was planning on writing such a utility - that's how I found Jacksum - but didn't want to release it under GPL. On the other hand, I'd also prefer not to re-invent any wheels.

The ultimate goal is to compare old and new jar/zip files. One might make the interface smart enough to skip component validation if the jar/zip calculations match.

Some justification
In my experience, it is not unusual for a library to be completely recompiled even though only one or two classes have actually changed. Knowing what has changed (without having to trust the vendor's docs) can identify the extent of regression testing required by the new library. Yes, the steps noted above _can_ be scripted, but given Java's Zip/Jar APIs, it shouldn't be necessary.

I would be more than happy to provide prototype Java for opening, reading the jar/zip, if you wish. On the other hand, the API isn't that complicated.

Discussion

  • Johann N. Löfflmann

    • milestone: --> Next_Release
    • assigned_to: nobody --> jonelo
     
  • Johann N. Löfflmann

    Sorry for the delay. Actually it sounds like a good feature request to me. Let's reserve option -z for that.

    -jonelo

     
  • Johann N. Löfflmann

    • labels: 645713 --> Interface Improvements
     

Log in to post a comment.

MongoDB Logo MongoDB