Welcome the the Ranch, Velan!
I'm not sure that you want to "list" files so much as enumerate them or collect their names/paths. To "list" files in Linux, a command line would suffice:
Traditionally, to enumerate and/or collect in
Java, you'd use the file list() method with a filter that gives a yes/no indication for each file scanned to indicate whether it matched your selected
pattern.
Alternatively these days, there are evil things you can do with Lamba expressions to the same effect, but I'll leave the details to others.