我希望在桌面上阅读文件+文件夹快捷方式 凭借其创建日期和修改/上次访问日期......所以我应该做出哪些更改
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class read {
public static void main(String[] args) {
List<File> fileList =new ArrayList();
final File folder = new File("C:\\Users\\ROSH\\Desktop");
new read().listFilesForFolder(folder, fileList);
}
public void listFilesForFolder(final File folder,List<File> fileList) {
File[] filesInFolder = folder.listFiles();
if (filesInFolder != null) {
for (final File fileEntry : filesInFolder) {
if (fileEntry.isDirectory()) {
System.out.println("DIR : "+fileEntry.getName());
listFilesForFolder(fileEntry,fileList);
} else {
System.out.println("FILE : "+fileEntry.getName());
fileList.add(fileEntry);
}
}
}
}