|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xins.common.net.IPAddressUtils
IP address-related utility functions.
Method Summary | |
static String |
getLocalHost()
Retrieves the localhost host name. |
static String |
getLocalHostIPAddress()
Retrieves the localhost IP address. |
static String |
getLocalHostJava13()
Retrieves the localhost host name, on Java 1.3. |
static String |
getLocalHostJava14()
Retrieves the localhost host name, on Java 1.4 and up. |
static int |
ipToInt(String ip)
Converts an IP address in the form a.b.c.d to an int . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int ipToInt(String ip) throws IllegalArgumentException, ParseException
int
.
ip
- the IP address, must be in the form:
a.a.a.a., where a is a number between 0 and 255,
with no leading zeroes; cannot be null
.
int
.
IllegalArgumentException
- if ip == null
.
ParseException
- if ip
cannot be parsed as an IP address.public static String getLocalHostIPAddress()
"127.0.0.1"
.public static String getLocalHost()
"localhost"
.public static String getLocalHostJava13()
"localhost"
.public static String getLocalHostJava14()
"localhost"
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |