public static File[] getFilesListByExtention( String folderPath, final String ext ) {
        File[] files = new File(folderPath).listFiles(new FilenameFilter(){
            public boolean accept( File dir, String name ) {
                return name.endsWith(ext);
            }
        });
        return files;
    }
public static File [ ] getFilesListByExtention ( String folderPath , final String ext ) { File [ ] files = new File ( folderPath ) . listFiles ( new FilenameFilter ( ) { public boolean accept ( File dir , String name ) { return name . endsWith ( ext ) ; } } ) ; return files ; }
Get the list of files in a folder by its extension.

@param folderPath the folder path.
@param ext        the extension without the dot.

@return the list of files patching.