Create a class implementing FileFilter. Override its method: public boolean accept(File Pathname). Call that method and put it in your ArrayList and you can use it as you want.
Use File's listFiles method in combination with that FileFilter, and you'll have an array with the File objects. The array size is the number of files.