private static boolean addFileToZip(@NotNull ZipOutputStream zos,
                                     @NotNull File file,
                                     @NotNull String relativeName,
                                     @Nullable Set<? super String> writtenItemRelativePaths,
                                     @Nullable FileFilter fileFilter,
                                     @NotNull FileContentProcessor contentProcessor,
                                     long timestamp,
                                     boolean isDir) throws IOException {
    while (!relativeName.isEmpty() && relativeName.charAt(0) == '/') {
      relativeName = relativeName.substring(1);
    }

    if (isDir && !Strings.endsWithChar(relativeName, '/')) {
      relativeName += "/";
    }
    if ((fileFilter != null && !FileUtilRt.isFilePathAcceptable(file, fileFilter)) ||
        (writtenItemRelativePaths != null && !writtenItemRelativePaths.add(relativeName))) {
      return false;
    }

    if (LOG.isDebugEnabled()) {
      LOG.debug("Add " + file + " as " + relativeName);
    }

    long size = isDir ? 0 : file.length();
    ZipEntry e = new ZipEntry(relativeName);
    e.setTime(timestamp);
    if (size == 0) {
      e.setMethod(ZipEntry.STORED);
      e.setSize(0);
      e.setCrc(0);
    }
    zos.putNextEntry(e);
    if (!isDir) {
      try (InputStream is = contentProcessor.getContent(file)) {
        FileUtilRt.copy(is, zos);
      }
    }
    zos.closeEntry();
    return true;
  }
private static boolean addFileToZip(@NotNull ZipOutputStream zos,
                                     @NotNull File file,
                                     @NotNull String relativeName,
                                     @Nullable Set<? super String> writtenItemRelativePaths,
                                     @Nullable FileFilter fileFilter,
                                     @NotNull FileContentProcessor contentProcessor,
                                     long timestamp,
                                     boolean isDir)