rivate static String getHostname(String url) {
    try {
      return new URL(url).toURI().getHost();
    }
    catch (URISyntaxException | MalformedURLException ignored) {
    }
    return null;
  }

rivate static String getHostname(String url) 