import java.io.File;
public class DirSize {
public static void main(String[] args) {
File dir = new File("/home/huanyu/Desktop");
String[] files = dir.list();
if (files == null){
System.out.println("目录为空!!!");
}else {
for (int i=0; i<files.length; i++){
System.out.println(files[i]);
}
}
}
}