scijava-common icon indicating copy to clipboard operation
scijava-common copied to clipboard

Add support for compressed handles

Open gab1one opened this issue 8 years ago • 3 comments

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.

gab1one avatar Jul 07 '17 15:07 gab1one

  • 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 arbitrary BrowsableLocation can work with no changes with these compressed formats.
  • ZipEntry is a lot like File, including stuff like last modified datestamp, which corresponds to DataHandle in our paradigm. So a ZipEntryHandle would make sense.
  • The ZipLocation points at a Location corresponding to the ZIP data. Its parent() method returns null. (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 use java.util.zip.ZipEntry!) would have a parent ZipLocation together with a String for the entry name. It is not stateful.

ctrueden avatar Aug 31 '17 16:08 ctrueden

@gab1one What is the status of this PR now?

ctrueden avatar Dec 19 '18 19:12 ctrueden

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.

ctrueden avatar Nov 12 '21 22:11 ctrueden