How to retrieve a list of directories QUICKLY in Java?

后端 未结 14 1009
轮回少年
轮回少年 2020-12-01 12:45

Suppose a very simple program that lists out all the subdirectories of a given directory. Sound simple enough? Except the only way to list all subdirectories in Java is to u

14条回答
  •  甜味超标
    2020-12-01 12:48

    Well, either JNI, or, if you say your deployment is constant, just run "dir" on Windows or "ls" on *nixes, with appropriate flags to list only directories (Runtime.exec())

提交回复
热议问题