static Set<Path> getAllFiles(Set<Path> paths) throws IOException {
    Set<Path> expanded = new HashSet<>();
    for (Path path : paths) {
      if (Files.isRegularFile(path)) {
        expanded.add(path);
      } else if (Files.isDirectory(path)) {
        try (Stream<Path> dirWalk = Files.walk(path)) {
          dirWalk.filter(Files::isRegularFile).forEach(expanded::add);
        }
      }
    }
    return expanded;
  }
Expand directories to files (excludes directory paths).
jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java