Here you can find the source of listDocTypeName(Path path)
public static List<String> listDocTypeName(Path path) throws IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; public class Main { public static List<String> listDocTypeName(Path path) throws IOException { return Files.walk(path, 2).filter(x -> x.getFileName().toString().endsWith("chapter.md")) .map(x -> x.getParent().getFileName().toString()).distinct().sorted().collect(Collectors.toList()); }//from w ww . j a v a 2 s . com }