code: private void addEntry(final Path pathToFile, final URL resource) throws IOException {
  
          final Path parent = pathToFile.getParent();
          if (parent != null) {
              addFolder(parent);
          }
          try (InputStream inputStream = resource.openStream()) {
              Files.copy(inputStream, pathToFile);
          }
      }
docs: Creates an entry under the specifeid path with the content from the provided resource.
  
  @param pathToFile
  the path to the file in the zip file.
  @param resource
  the resource providing the content for the file. Must not be null.
  
  @throws IOException