List of utility methods to do Host Check
String | normalizeHostName(String name) Given a string representation of a host, return its ip address in textual presentation. try { return InetAddress.getByName(name).getHostAddress(); } catch (UnknownHostException e) { return name; |
List | normalizeHostNames(Collection Given a collection of string representation of hosts, return a list of corresponding IP addresses in the textual representation. List<String> hostNames = new ArrayList<String>(names.size()); for (String name : names) { hostNames.add(normalizeHostName(name)); return hostNames; |