code: public static String getLocalHostAddress() {
          String ipAddr = CoGProperties.getDefault().getIPAddress();
          if (ipAddr == null) {
              try {
                  return InetAddress.getLocalHost().getHostAddress();
              } catch (UnknownHostException e) {
                  return "127.0.0.1";
              }
          } else {
              return ipAddr;
          }
      }
docs: Returns the ip address of the local machine.
  If the 'ip' system property is defined it is returned,
  otherwise, the local ip address is lookup using the
  <code>InetAddress</code> class. In case the lookup
  fails, the address 127.0.0.1 is returned.
  
  @return local ip address