I implemented a recursive method to traverse a directory hierarchy looking for files with a given extension; however I'm not convinced this is the easiest way and it involves isDirectory()
, listFiles()
, etc.
Is there a way to do that without explicitly writing a recursive method: I'm thinking something like find
that would directly return a list of files or filenames (with their full path) at any level in the structure matching the correct extension. I would then just loop over these files.
Any help appreciated.