Does anyone know, why the File class doesn’t provide an iterator method? To loop all the files in a folder I have to use the listFiles() method. Of course I can pass in a FileFilter. But it still seems more efficient to me, if I could get a file iterator from the folder. Theoretically for very large folders it would take a lot of memory and takes unnecessary time to allocate and fill the array. Additionally the listFiles() method first reads a full array of filenames and then derives a File array from it. This is doubly inefficient. And I guess, the code also creates something like an ArrayList, which has to recreate the uderlying array again and again when it is filled.
This is all fine, if I need the files as an array. But if I needs them in a different container or just want to loop over them, this seems to be dumb.
How can I effectively suggest this to Oracle?
Marvin