net.i2p.util
Class Addresses

java.lang.Object
  extended by net.i2p.util.Addresses

public abstract class Addresses
extends Object

Get the local addresses

Since:
0.8.3 moved to core
Author:
zzz

Constructor Summary
Addresses()
           
 
Method Summary
static SortedSet<String> getAddresses()
           
static SortedSet<String> getAddresses(boolean includeLocal, boolean includeIPv6)
           
static SortedSet<String> getAllAddresses()
           
static String getAnyAddress()
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Addresses

public Addresses()
Method Detail

getAnyAddress

public static String getAnyAddress()
Returns:
the first non-local address it finds, or null

getAddresses

public static SortedSet<String> getAddresses()
Returns:
a sorted set of all addresses, excluding IPv6, local, broadcast, multicast, etc.

getAllAddresses

public static SortedSet<String> getAllAddresses()
Returns:
a sorted set of all addresses, excluding only link local and multicast
Since:
0.8.3

getAddresses

public static SortedSet<String> getAddresses(boolean includeLocal,
                                             boolean includeIPv6)
Parameters:
includeLocal - whether to include local
includeIPv6 - whether to include IPV6
Returns:
a sorted array of all addresses
Since:
0.8.3

main

public static void main(String[] args)