标签:java span directory rect pack lis main rgs apple
package searchdir;
import java.io.File;
public class WalkDir {
public static void main(String[] args) {
File file = new File("/System");
listF(file);
}
public static void listF(File file) {
if (file.isFile()) {
if (file.getName().contains("sys")) {
System.out.println(file.getAbsolutePath());
}
return;
} else {
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files == null) {
return;
}
for (File o : files) {
listF(o);
}
}
}
}
}
标签:java span directory rect pack lis main rgs apple
原文地址:http://www.cnblogs.com/mabel/p/6420980.html