how to File.listFiles in alphabetical order?
The listFiles method, with or without a filter does not guarantee any order. It does, however, return an array, which you can sort with Arrays.sort(). File[] files = XMLDirectory.listFiles(filter_xml_files); Arrays.sort(files); for(File _xml_file : files) { … } This works because File is a comparable class, which by default sorts pathnames lexicographically. If you want to … Read more