filemanager

/**
* 文件夹的统计
*
*/
static int count = 0;

public static int refreshFileList(File dir) {
int sum = 0;
File[] files = dir.listFiles();
for (int i = 0; i < files.length; i++) {
String str = files[i].getAbsoluteFile().toString();
boolean sub = false;
sub = str.contains(".");
if (sub == true) {
count++;
}
if (files[i].isDirectory()) {
refreshFileList(files[i]);
sum = count++;
}
}
return sum;
}

你可能感兴趣的:(manager)