|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.util.Addresses
public abstract class Addresses
Methods to get the local addresses, and other IP utilities
Constructor Summary | |
---|---|
Addresses()
|
Method Summary | |
---|---|
static void |
clearCaches()
|
static SortedSet<String> |
getAddresses()
|
static SortedSet<String> |
getAddresses(boolean includeLocal,
boolean includeIPv6)
|
static SortedSet<String> |
getAddresses(boolean includeSiteLocal,
boolean includeLoopbackAndWildcard,
boolean includeIPv6)
|
static SortedSet<String> |
getAllAddresses()
|
static String |
getAnyAddress()
|
static byte[] |
getIP(String host)
Caching version of InetAddress.getByName(host).getAddress(), which is slow. |
static int |
getPort(String port)
Convenience method to convert and validate a port String without throwing an exception. |
static boolean |
isConnected()
Do we have any non-loop, non-wildcard IPv4 address at all? |
static void |
main(String[] args)
Print out the local addresses |
static String |
toString(byte[] addr)
Convenience method to convert an IP address to a String without throwing an exception. |
static String |
toString(byte[] addr,
int port)
Convenience method to convert an IP address and port to a String without throwing an exception. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Addresses()
Method Detail |
---|
public static boolean isConnected()
public static String getAnyAddress()
public static SortedSet<String> getAddresses()
public static SortedSet<String> getAllAddresses()
public static SortedSet<String> getAddresses(boolean includeLocal, boolean includeIPv6)
includeLocal
- whether to include localincludeIPv6
- whether to include IPV6
public static SortedSet<String> getAddresses(boolean includeSiteLocal, boolean includeLoopbackAndWildcard, boolean includeIPv6)
includeSiteLocal
- whether to include private like 192.168.x.xincludeLoopbackAndWildcard
- whether to include 127.x.x.x and 0.0.0.0includeIPv6
- whether to include IPV6
public static String toString(byte[] addr)
public static String toString(byte[] addr, int port)
public static int getPort(String port)
public static byte[] getIP(String host)
host
- DNS or IPv4 or IPv6 host name; if null returns null
public static void clearCaches()
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |