1

There are related questions, but none of them addresses the "lazy" part, that is, discover more content only as the iteration progresses.

See How do I iterate through the files in a directory in Java?

Also Apache Commons FileUtils.iterateFiles() reads all files into a Collection (List) at first before getting the Iterator on that.

I have a nested directory structure with a large amount of files (2 million). My goal is to iterate the files without having to read all the names into a collection.

joopRksn
  • 11
  • 2

0 Answers0