Better sorting should do 2 things: 1) case insensitive 2) aware of numbers in the file names. So File2 comes after File1 (obviously) but before File10 http://jroller.com/page/tfenne?entry=humanestringcomparator_sorting_strings_for_people source: http://jroller.com/resources/t/tfenne/HumaneStringComparator.java Switch comparison - http://java-performance.info/string-switch-performance/