yuchesc / sczip   1.0.0

MIT License GitHub

Zip archive for Scala.

Scala versions: 2.12 2.11


Simple zip archive (files compresses recursively) library for Scala.

How to use

Using Java NIO.

    // Add files recursively and make zip data.
    val list: Seq[String] = ScZip.zipTreeToFile(Paths.get("./project"), Paths.get("out.zip"))
    list.foreach(println) // entry files

    // Can get zip data instead of file
    val data: Array[Byte] = ScZip.zipTreeToBytes(Paths.get("./project"))

    // Set exclude condition by glob pattern without "glob:".
    ScZip.zipTreeToFile(Paths.get("./project"), Paths.get("out.zip"), ScZip.makeExclude("**/*.{cache,class}"))
    val data2 = ScZip.zipTreeToBytes(Paths.get("./project"), ScZip.makeExclude("**/*.{cache,class}"))

That's all.


It is available for 2.11 or 2.12.

Please append it in your libraryDependencies :)

libraryDependencies ++= Seq(
  "com.yuchesc" %% "sczip" % "1.0.0"

This software is released under the MIT License, see LICENSE.txt.