How would I scan an entire folder in my Java code and then read each text file in to a separate array? What I'm trying to do is have a set of LocationNodes(class I created) on a map app that I'm creating for my college campus/side project for my resume.
When the code initializes, I want my app to scan for all text files in my "LocationTextFiles" folder. Each text file has 3 sets of text: Line 0 (the name of the location), Line 1 (Hours the building is open), and Line 2-EOF (description of the location). I then would take these lines stick them in a new LocationNode object every time and then create a new LocationNode object to repeat the process until all files that were found have been read.
What's the best way to go about doing this? I have the class set up with it's attributes (name, hoursText, and descriptionText), so I'm assuming this function that I would create would need to be a public method of this same LocationNode class?