code: public static void zipDir(String dirName, String nameZipFile) throws IOException {
          try (FileOutputStream fW = new FileOutputStream(nameZipFile);
               ZipOutputStream zip = new ZipOutputStream(fW)) {
              addFolderToZip("", dirName, zip);
          }
      }
docs: Compresses directory into zip archive.
  
  @param dirName the path to the directory
  @param nameZipFile archive name.
  @throws IOException