public Builder addEntryRecursive(
        Path sourceFile,
        AbsoluteUnixPath pathInContainer,
        FilePermissionsProvider filePermissionProvider,
        ModificationTimeProvider modificationTimeProvider,
        OwnershipProvider ownershipProvider)
        throws IOException {
      FilePermissions permissions = filePermissionProvider.get(sourceFile, pathInContainer);
      Instant modificationTime = modificationTimeProvider.get(sourceFile, pathInContainer);
      String ownership = ownershipProvider.get(sourceFile, pathInContainer);
      addEntry(sourceFile, pathInContainer, permissions, modificationTime, ownership);
      if (!Files.isDirectory(sourceFile)) {
        return this;
      }
      try (Stream<Path> files = Files.list(sourceFile)) {
        for (Path file : files.collect(Collectors.toList())) {
          addEntryRecursive(
              file,
              pathInContainer.resolve(file.getFileName()),
              filePermissionProvider,
              modificationTimeProvider,
              ownershipProvider);
        }
      }
      return this;
    }
Adds an entry to the layer. If the source file is a directory, the directory and its contents
will be added recursively.

@param sourceFile the source file to add to the layer recursively
@param pathInContainer the path in the container file system corresponding to the {@code
    sourceFile}
@param filePermissionProvider a provider that takes a source path and destination path on the
    container and returns the file permissions that should be set for that path
@param modificationTimeProvider a provider that takes a source path and destination path on
    the container and returns the file modification time that should be set for that path
@param ownershipProvider a provider that takes a source path and destination path on the
    container and returns the ownership that should be set for that path
@return this
@throws IOException if an exception occurred when recursively listing the directory
jib-build-plan/src/main/java/com/google/cloud/tools/jib/api/buildplan/FileEntriesLayer.java