Skip to content

3.0.0

Choose a tag to compare

@lhns lhns released this 27 Aug 17:43
· 43 commits to main since this release
a699cee

Breaking

  • Zip4JUnarchiver.make takes the password first, matching Zip4JArchiver.make (#345).
    A positional make(chunkSize) no longer compiles, and the old method is gone from the
    bytecode. Use make(chunkSize = 8192), or make(password, chunkSize).
  • Zip archivers write the compression method their factory names, instead of deferring to a
    method carried on the entry (#349). An entry copied out of another archive is now written
    with the method you asked for, and with a compressed size describing what is actually
    written — previously a copied entry could be silently deflated by makeStored, or rejected
    outright by makeDeflated.

Added

  • ZipArchiver.makeStored works. It never has: STORED writes the CRC into the header ahead of
    the data, and nothing ever set one, so every entry with content failed. The CRC is now given
    to the entry, and an entry read out of a zip brings its own (#349):

    ArchiveEntry[Some, Any]("photo.jpg", Some(size)).withCrc(crc) -> data
    
  • Encrypted zip archives can be unarchived: Zip4JUnarchiver.make(Some(password)) (#345),
    from work by @erikvanoosten.

  • Missing-instance errors name what to do instead of only the trait (#351).

Fixed

  • Archivers and compressors are cancelable (#341). Cancelling a stream mid-archive used to
    block until the underlying java.io call returned on its own.
  • Unarchiving terminates when entries are skipped or only partly read (#295, #341, #342).
    Listing the names in a zip without reading any data hung forever; so did stopping halfway
    through an entry. Fixed by @hugovanrijswijk and generalised across all three unarchivers.
    Reading data from an entry the archive has already passed now raises IllegalStateException
    rather than returning bytes belonging to a different entry.

Changed

  • fs2 3.13.0, cats-effect 3.7.1, Scala 3.3.8 / 2.13.18 / 2.12.21.
  • Built with sbt 2 (#347). No change to the published artifacts.
  • brotli4j 1.23.0, zstd-jni 1.5.7-15, commons-compress 1.28.0, snappy-java 1.1.10.8,
    lz4-java 1.8.1, zip4j 2.11.6, plus routine dependency updates.

Documentation

  • The decisions behind the library are written down in docs/adr (#343, #344).
  • The README examples compile now (#352). Six of them did not, one only on Scala.js.

Contributors: @erikvanoosten, @hugo-vrijswijk, @jakobmerrild