递归读取目录及文件
http://www.diybl.com/ 2008-2-21 网络 点击:
[ 评论 ]
文章搜索:
【点击打包该文章】
package application.file;
import java.io.File;
public class ReadeBooksList {
public void getBooksList(String strPath) {
File file = new File(strPath);
if (file.isDirectory()) {
File[] fList = file.listFiles();
for (int j = 0; j < fList.length; j++) {
if (fList[j].isDirectory()) {
System.out.println(fList[j].getPath());
getBooksList(fList[j].getPath());
}
if (fList[j].isFile()) {
System.out.println(fList[j].getPath());
}
}
}
}
}
如果图片或页面不能正常显示请点击这里 站内搜索:
推荐文章 |
