code: private void writeEntry(JarEntry entry, EntryWriter entryWriter) throws IOException {
          String parent = entry.getName();
          if (parent.endsWith("/")) {
              parent = parent.substring(0, parent.length() - 1);
          }
          if (parent.lastIndexOf("/") != -1) {
              parent = parent.substring(0, parent.lastIndexOf("/") + 1);
              if (parent.length() > 0) {
                  writeEntry(new JarEntry(parent), null);
              }
          }
  
          if (this.writtenEntries.add(entry.getName())) {
              this.jarOutput.putNextEntry(entry);
              if (entryWriter != null) {
                  entryWriter.write(this.jarOutput);
              }
              this.jarOutput.closeEntry();
          }
      }
docs: Perform the actual write of a {@link JarEntry}. All other {@code write} method
  delegate to this one.
  
  @param entry       the entry to write
  @param entryWriter the entry writer or {@code null} if there is no content
  @throws IOException in case of I/O errors