scijava-common
scijava-common copied to clipboard
Add support for compressed handles
This PR adds support for compressed handles, that operate on archives: namely .zip, .gzip and bzip2 archives.
This requires #339 and #340 to be merged first.
- We should consider using Apache Commons Compress to read (and maybe write, though less important) these formats and more.
- The locations should implement
BrowsableLocation(as currently on master) such that code that works on arbitraryBrowsableLocationcan work with no changes with these compressed formats. -
ZipEntryis a lot likeFile, including stuff like last modified datestamp, which corresponds toDataHandlein our paradigm. So aZipEntryHandlewould make sense. - The
ZipLocationpoints at aLocationcorresponding to the ZIP data. Itsparent()method returnsnull. (It could return the containing folder of the zip, but this has pros and cons. We should perhaps experiment with that.) - A
ZipElementLocation(naively,ZipEntryLocation, but it does not usejava.util.zip.ZipEntry!) would have a parentZipLocationtogether with aStringfor the entry name. It is not stateful.
@gab1one What is the status of this PR now?
I rebased this over the latest master, removing one commit that was obsolete (which fixed the handling of unknown lengths in an incompatible way with a different fix that was already merged). @hinerm I'd value your input on this PR at some point when you have time. No rush though.