code: public static List<File> listAllFiles( File directory, String fileExtension ) {
  
  		String ext = fileExtension;
  		if( ext != null ) {
  			ext = ext.toLowerCase();
  			if( ! ext.startsWith( "." ))
  				ext = "." + ext;
  		}
  
  		List<File> result = new ArrayList<> ();
  		for( File f : listAllFiles( directory )) {
  			if( ext == null || f.getName().toLowerCase().endsWith( ext ))
  				result.add( f );
  		}
  
  		return result;
  	}
docs: Finds all the files (directly and indirectly) contained in a directory and with a given extension.
  <p>
  Search is case-insensitive.
  It means searching for properties or PROPERTIES extensions will give
  the same result.
  </p>
  
  @param directory an existing directory
  @param fileExtension a file extension (null will not filter extensions)
  <p>
  If it does not start with a dot, then one will be inserted at the first position.
  </p>
  
  @return a non-null list of files