public static void visitFile()

in dobbo-doc-auto-gen/src/main/java/org/apache/dubbo/doc/DocAutoGen.java [73:99]


    public static void visitFile(File file, String parentPath, int level) {
        File[] files = file.listFiles();
        // gen code sort by file name
        Arrays.sort(files, (o1, o2) -> {
            if (o1.isDirectory() && o2.isFile()) {
                return -1;
            }
            if (o1.isFile() && o2.isDirectory()) {
                return 1;
            }
            return o1.getName().compareTo(o2.getName());
        });
        for (int i = 0; i < files.length; i++) {
            File f = files[i];
            String name = f.getName();
            if (name.startsWith("dubbo-")) {
                String blank = "";
                for (int j = 0; j < level; j++) {
                    blank += "  ";
                }

                String currentPath = level == 0 ? name : parentPath + "/" + name;
                System.out.println(blank + "- [" + name + "]" + "(" + currentPath + ")");
                visitFile(f, currentPath, level + 1);
            }
        }
    }