As far as I know, there is no natural order that files tend to. If you speak alphabetic, then with what language / sort sequence? Do all operating systems supported by java do support in order? If not, then the API will have to use everything that was received from the OS. Since it is likely that the API client 1) may not bother you, or 2) wants something else, it is much more reasonable to simply deliver files without a guaranteed order, rather than doing empty sorting. If you do not care, you can do it.
source share