Comparator<? super File> filecomparatorByLastModified = new Comparator<File>(){
public int compare(File file1, File file2) {
if(file1.isDirectory()){
if (file2.isDirectory()){
return Long.valueOf(file1.lastModified()).compareTo(file2.lastModified());
}else{
return -1;
}
}else {
if (file2.isDirectory()){
return 1;
}else{
return Long.valueOf(file1.lastModified()).compareTo(file2.lastModified());
}
}
}
};
Download the files.
No comments:
Post a Comment