def filesDir = $files.getFilesDir() def src = $files.buildFile { setPath(filesDir, "tmp/abc.txt") } src.writeText("hello world", "UTF-8") def dest = $files.buildFile { setPath(filesDir, "tmp/abc.zip") } $console.log($files.zipFile(src, dest, null)) $console.log(dest.exists() && dest.isFile()) def unzipDir = $files.buildFile { setPath(filesDir, "tmp/abc") } $console.log($files.unzipFile(dest, unzipDir, null)) $console.log(unzipDir.exists() && unzipDir.isDirectory()) src.delete() dest.delete() unzipDir.deleteRecursively()