Java IP Address Get getIntranetIp()

Here you can find the source of getIntranetIp()

Description

get Intranet Ip

License

Open Source License

Declaration

public static String getIntranetIp() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.net.InetAddress;

public class Main {
    private static String intranetIp;

    public static String getIntranetIp() {
        if (intranetIp == null) {
            try {
                intranetIp = InetAddress.getLocalHost().getHostAddress();
            } catch (Exception e) {
                intranetIp = "127.0.0.1";
            }//from w  w w .  j  a va2s  .c om
        }
        return intranetIp;
    }
}

Related

  1. getInterfaceIPs()
  2. getInternalIp()
  3. getInternalIp()
  4. getInternetIpAddress()
  5. getIntfFromLabelAdva(int n, Inet4Address ip)
  6. getIp()
  7. getIp()
  8. getIP()
  9. getIp()