private static Stream<File> extractJarNames(File war) {
    try (JarFile warContents = new JarFile(war)) {
      return warContents.stream()
          // Look for jars in the war
          .filter(entry -> entry.getName().endsWith(".jar"))
          // Create a File with a path that includes the war name
          .map(entry -> new File(war.getName(), entry.getName()))
          // Materialize the list of files while the war is still open
          .collect(Collectors.toList()).stream();
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
Find of of the jar files embedded within a war
geode-assembly/src/integrationTest/java/org/apache/geode/BundledJarsJUnitTest.java