berial / FileTreePrinter

打印指定路径的目录树

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FileTreePrinter

打印指定路径的目录树 Print the directory tree for the specified path

class Test {

    public static void main(String[] args) {
        String dir = "C:\\Program Files\\Internet Explorer";
        FileTreePrinter printer = new FileTreePrinter(dir);
        printer.printFileTree();

//        try {
//            printer.createFileTreeFile("D:\\test.txt");
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }
    }
}

print:

+--- en-US
|    \--- hmmapi.dll.mui
+--- images
|    \--- bing.ico
+--- SIGNUP
|    \--- install.ins
+--- zh-CN
|    +--- ieinstal.exe.mui
|    \--- iexplore.exe.mui
+--- ExtExport.exe
+--- hmmapi.dll
+--- iediagcmd.exe
+--- ieinstal.exe
+--- ielowutil.exe
+--- IEShims.dll
\--- iexplore.exe

About

打印指定路径的目录树

License:Apache License 2.0


Languages

Language:Java 100.0%