static int zipBot_compressionLevel = 9; // highest! // returns true if actual zip file (not empty) static boolean zipBot(S botToZip, File destZip) ctex { File dir = getProgramDir(botToZip); mkdirsForFile(destZip); FileOutputStream fout = new FileOutputStream(destZip); ZipOutputStream zout = new ZipOutputStream(fout); zout.setLevel(zipBot_compressionLevel); int count = 0; if (dir.isDirectory()) count += dir2zip(dir, zout, "JavaX-Data/" + botToZip + "/"); if (count == 0) { print("Nothing to zip for bot " + botToZip); fout.close(); return false; } else { zout.close(); print("Zipped " + botToZip + " (" + count + " entries) to " + destZip.getAbsolutePath() + " (" + destZip.length() + " bytes)"); return true; } }