Returns the lowercased hostname for the url or null if the url is not well formed. @param url The url to check. @return String The hostname for the url.
(String url)
| 383 | * @return String The hostname for the url. |
| 384 | */ |
| 385 | public static String getHost(String url) { |
| 386 | try { |
| 387 | return new URL(url).getHost().toLowerCase(Locale.ROOT); |
| 388 | } catch (MalformedURLException e) { |
| 389 | return null; |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | /** |
| 394 | * Returns the page for the url. The page consists of the protocol, host, and |
no outgoing calls
no test coverage detected