public static boolean isImage(File path,boolean jpgOnly){
  if (path == null)   return false;
  return isImage(path.getName(),jpgOnly);
}

public static boolean isImage ( File path , boolean jpgOnly ) { if ( path == null ) return false ; return isImage ( path . getName ( ) , jpgOnly ) ; }
return true if path is " * . jp ( e ) g "
