Please edit your post to add code tags; it will preserve the spaces in your diagram.
I have only ever sen it done recursively, using the methods of the
File class. Remember that File can refer to a directory as well as an ordinary file, so you can get an array of contained files in a directory. You can check whether the name of a file ends with "FOL" using the methods of the
String class, if necessary. You can also put a filter on a search.