62,614
社区成员
发帖
与我相关
我的任务
分享
public static void tree(File f){
if(f.getName().equals("System Volume Information"))
return; //加这句,这个文件夹是无法访问的。
String[] s = null;
File[] trees = f.listFiles();
for(int i=0;i<trees.length;i++)
{
if(trees[i].isDirectory()){
tree(trees[i]);
}
s = trees[i].getName().split("\\.");
if(s[s.length-1].equals("jpg")) {//应该可能是这里报错了nullPointException吧!if not please show me locationSystem.out.println(trees[i].getAbsolutePath());
}
}