Could anyone post a simple snippet that does this?
Files are text files, so compression would be nice rather than just archive the files.
I have the filename
A bit modified (shorter) version using NIO2:
private def zip(out: Path, files: Iterable[Path]) = { val zip = new ZipOutputStream(Files.newOutputStream(out)) files.foreach { file => zip.putNextEntry(new ZipEntry(file.toString)) Files.copy(file, zip) zip.closeEntry() } zip.close() }