private static List jarsIn()

in invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java [431:453]


  private static List<URL> jarsIn(String dir) {
    Path path = Paths.get(dir);
    if (!Files.isDirectory(path)) {
      return Collections.emptyList();
    }
    Stream<Path> stream;
    try {
      stream = Files.list(path);
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
    return stream
        .filter(p -> p.getFileName().toString().endsWith(".jar"))
        .map(
            p -> {
              try {
                return p.toUri().toURL();
              } catch (MalformedURLException e) {
                throw new UncheckedIOException(e);
              }
            })
        .collect(toList());
  }