public static void zipDir ( String dirName , String nameZipFile ) throws IOException { try ( FileOutputStream fW = new FileOutputStream ( nameZipFile ) ; ZipOutputStream zip = new ZipOutputStream ( fW ) ) { addFolderToZip ( "" , dirName , zip ) ; } }
Compresses directory into zip archive .