Java Utililty Methods Host Check

List of utility methods to do Host Check

Description

The list of methods to do Host Check are organized into topic(s).

Method

StringnormalizeHostName(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;
ListnormalizeHostNames(Collection names)
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;