class Fetcher implements AutoCloseable {

    public CompletableFuture<Integer> fetchAndSumBodies(Path folder) throws IOException {
        return Files
            .walk(folder)          // Stream<Path>
            .filter(Files::isRegularFile)     // Stream<Path>
            .map(path -> AsyncFiles.readAll(path)) // Stream<CF<String>>
            .map(cf -> cf.thenCompose(url -> fetchBodyLength(url))) //Stream<Cf<Integer>
            .reduce((prev, curr) -> prev.thenCombine(curr, (l1, l2) -> l1 + l2))
            .get();
    }

}