List of utility methods to do URI to Host Name
String | getHost(final URI uri) Return just the host portion of the URI if applicable. String retval = uri.getHost(); if ((retval == null) && (uri.getAuthority() != null)) { final String text = uri.getAuthority(); final int ptr = text.indexOf(':'); if (ptr > -1) { retval = text.substring(0, ptr); return retval; |
String | getHost(URI uri) Extract host name from the URI String host = uri.getHost(); if (host != null) { return host; host = uri.toString(); int sInd = host.indexOf("//") + 2; host = host.substring(sInd); int eInd = host.indexOf("/"); ... |
String | getHost(URI uri) get Host String host = uri.getHost(); int port = uri.getPort(); if (port != -1) { host += ":" + port; return host; |
String | getHost(URI uri) get Host String host = uri.getHost(); if (host == null) { host = uri.getAuthority(); return host; |
InetAddress | getHostAddress(final URI uri) Get the address of the host. if (uri != null) { final String host = uri.getHost(); if (host != null) { try { return InetAddress.getByName(host); } catch (final Exception exception) { return null; |
InetAddress | getHostAddress(final URI uri) Get the address of the host. if (uri != null) { final String host = uri.getHost(); if (host != null) { try { return InetAddress.getByName(host); } catch (final Exception exception) { return null; |
String | getHostAndPort(URI u) get Host And Port String host = u.getHost(); int port = u.getPort(); return port < 1 ? host : host + ":" + port; |
String | getHostFromURI(final URI uri) Get the host (if available) from a URI. return uri.getHost();
|
URI | getHostUri() get Host Uri return getProperty("host.uri"); |