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

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members