Class HostnameUtil


  • public final class HostnameUtil
    extends java.lang.Object
    Static utility class to determine the local hostname.
    Since:
    4.0.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getHostname()
      Get the local hostname string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getHostname

        public static java.lang.String getHostname()
                                            throws java.net.UnknownHostException
        Get the local hostname string. This implementation actually return an IP address string.
        Returns:
        a hostname string
        Throws:
        java.net.UnknownHostException - if hostname resolution fails