Somewhere you could add a filter that only returns the files with the desired extensions. There are File class methods that work with filters.