public void check()

in src/main/java/org/apache/tomee/website/Checks.java [35:67]


    public void check(final File contentDir, final File generatedDir) {
        final List<String> ignored = getIgnored();

        try {
            final BiPredicate<Path, BasicFileAttributes> sources = (path, attributes) -> {
                if (!path.toFile().isFile()) return false;
                if (path.toString().endsWith(".adoc") || path.toString().endsWith(".md")) return true;
                return false;
            };

            final List<String> missing = Files.find(contentDir.toPath(), 100, sources)
                    .map(Path::toFile)
                    .map(File::getAbsolutePath)
                    .map(s -> s.substring(contentDir.getAbsolutePath().length() + 1))
                    // was the html not generated?
                    .filter(s -> {
                        final String html = s.replaceAll("\\.(adoc|md)$", ".html");
                        final File expected = new File(generatedDir, html);
                        return !expected.exists();
                    })
                    // is this file not in the list of known issues?
                    .filter(s -> !ignored.contains(s))
                    .collect(Collectors.toList());

            if (missing.size() > 0) {
                throw new HtmlGenerationFailedException(missing);
            }
            missing.forEach(System.out::println);
            System.out.println(missing);
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }