public static boolean urlEqualsHostIgnoreCase(String endpointUrl,String url){
  try {
    return urlEqualsHostIgnoreCase(new URI(endpointUrl),new URI(url));
  }
 catch (  URISyntaxException e) {
    return false;
  }
}

public static boolean urlEqualsHostIgnoreCase ( String endpointUrl , String url ) { try { return urlEqualsHostIgnoreCase ( new URI ( endpointUrl ) , new URI ( url ) ) ; } catch ( URISyntaxException e ) { return false ; } }
check if the endpointurl matches the url , except for the hostname part .
