Class NetworkInterfaceUtil


  • public class NetworkInterfaceUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getOwnPublicAddressAsText()
      Tries to determine any public IPv4 address for current host.
      static boolean isLocal​(java.lang.String ipAddress)
      Check if address represents local IP or hostname that resolves to local.
      • Methods inherited from class java.lang.Object

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

      • NetworkInterfaceUtil

        public NetworkInterfaceUtil()
    • Method Detail

      • getOwnPublicAddressAsText

        @Nullable
        public static java.lang.String getOwnPublicAddressAsText()
        Tries to determine any public IPv4 address for current host.
        Returns:
        any public IP address of current host or null
      • isLocal

        public static boolean isLocal​(@Nullable
                                      java.lang.String ipAddress)
        Check if address represents local IP or hostname that resolves to local.