static void addFilesByExtension(List<File> list, File dir, String[] extensions)
    {
        File[] files = dir.listFiles();
        for (int i = 0; i < files.length; i++)
        {
            File f = files[i];
            if (f.isDirectory())
                addFilesByExtension(list, f, extensions);
            else
            {
                for (String s : extensions)
                {
                    if (f.getName().endsWith(s))
                    {
                        list.add(f);
                        break;
                    }
                }
            }
        }
    }
Returns a list of file filtered by their file types/extensions; (E.g ".proto")
protostuff-compiler/src/main/java/io/protostuff/compiler/CompilerUtil.java