Class InetAddressUtil

java.lang.Object
org.archive.util.InetAddressUtil

public class InetAddressUtil extends Object
InetAddress utility.
Version:
$Date$, $Revision$
Author:
stack
  • Field Details

    • IPV4_QUADS

      public static Pattern IPV4_QUADS
      ipv4 address.
  • Method Details

    • getIPHostAddress

      public static InetAddress getIPHostAddress(String host)
      Returns InetAddress for passed host IF its in IPV4 quads format (e.g. 128.128.128.128).

      TODO: Move to an AddressParsingUtil class.

      Parameters:
      host - Host name to examine.
      Returns:
      InetAddress IF the passed name was an IP address, else null.
    • getAllLocalHostNames

      public static List<String> getAllLocalHostNames()
      Returns:
      All known local names for this host or null if none found.