import com.github.scalazip._
val myFile = new java.io.File("image.jpg")
val zip = myFile.zipAs("image.zip")
val file1 = new java.io.File("github1.jpg")
val file2 = new java.io.File("github2.jpg")
val file3 = new java.io.File("github3.jpg")
val files = file1 :: file2 :: file3 :: EmptyZip
val files = ZipArchive(file1, file2, file3)
// To Zip where you are running the JVM
val zip = myFile.zipAs("images.zip")
// To Zip at the source of the original head file
val zip = files.zipAtSource("images.zip")
val zip = new CompressedFile("image.zip")
val uncompressed = zip.unzipAtSource("images")
val zip = new CompressedFile("datasource.zip")
val maybeFound = zip.find(e => e.getName endsWith ".txt")
maybeFound match {
case Some(lines) => lines.take(10) foreach println
case None => println("No .txt file found")
}
val file1 = new File("image1.jpg")
val file2 = new File("image2.jpg")
val file3 = new File("atextfile.txt")
val files = file1 :: file2 :: file3 :: EmptyZip
val zip = files.zipAs("stuff.zip")
val file = zip.unzipAs("stuff")
================
- Ajust the Zip Reader
- Work with encrypted zip files