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 hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?