code: private static void addFolderToZip(String path, File folder, ZipOutputStream zos) throws IOException {
          String currentPath = StringUtils.isNotEmpty(path)? path + "/" + folder.getName(): folder.getName();
  
          for (File file : folder.listFiles()) {
              if (file.isDirectory()) {
                  addFolderToZip(currentPath, file, zos);
              } else {
                  addFileToZip(currentPath, file, zos);
              }
          }
      }
docs: Adds a directory to the current zip
  
  @param path   the path of the parent folder in the zip
  @param folder the directory to be  added
  @param zos    the current zip output stream
  @throws FileNotFoundException
  @throws IOException