public boolean matches(String filename){
  if (exts == null)   return true;
  int j=filename.lastIndexOf(".");
  if (j == -1 || j == filename.length())   return false;
  String suffix=filename.substring(j + 1);
  return exts.contains(suffix);
}

public boolean matches ( String filename ) { if ( exts == null ) return true ; int j = filename . lastIndexOf ( "." ) ; if ( j == - 1 || j == filename . length ( ) ) return false ; String suffix = filename . substring ( j + 1 ) ; return exts . contains ( suffix ) ; }
returns true if a file with the given name is of this media type , i . e . , the suffix of the filename matches one of this ' extensions .
