best proceed list files java, sorted date modified?
i wish list files directory, nonetheless i wish arrange such oldest files first. fortitude file.listfiles only review list formed file.lastmodified, nonetheless i wondering there improved way.
edit: tide solution, suggested, an opposite comparator:
file[] files = directory.listfiles();
arrays.sort(files, new comparator<file>(){
open int compare(file f1, record f2)
{
relapse long.valueof(f1.lastmodified()).compareto(f2.lastmodified());
} });
Comments
Post a Comment