|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.lindenbaum.maven.util.NetworkUtils
public final class NetworkUtils
Containing network related utilities for IP resolution.
| Constructor Summary | |
|---|---|
NetworkUtils()
|
|
| Method Summary | |
|---|---|
static Collection<InetAddress> |
filterInetAddresses(Collection<InetAddress> in,
boolean ipv4only)
Filters the elements of the given Collection of InetAddress
objects for IPv4 or IPv6 addresses. |
static Collection<InetAddress> |
getInetAddresses()
Returns the InetAddresses as returned by the network interfaces of
this host. |
static String |
getIPv4Address()
Returns a valid IPv4 address for this host. |
static Collection<InetAddress> |
sortInetAddresses(Collection<InetAddress> in)
Orders the elements of the given Collection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NetworkUtils()
| Method Detail |
|---|
public static String getIPv4Address()
throws org.apache.maven.plugin.MojoExecutionException
null string containing one network address of this
host
org.apache.maven.plugin.MojoExecutionException - in case no up network interfaces could be
detected
public static Collection<InetAddress> getInetAddresses()
throws org.apache.maven.plugin.MojoExecutionException
InetAddresses as returned by the network interfaces of
this host. Addresses of network interfaces currently not up are excluded.
null collection of network addresses.
org.apache.maven.plugin.MojoExecutionException
public static Collection<InetAddress> filterInetAddresses(Collection<InetAddress> in,
boolean ipv4only)
Collection of InetAddress
objects for IPv4 or IPv6 addresses. The input collection will not be
modified, instead a new Collection will be returned. Multicast and
wildcard addresses will be filtered out.
in - to filter for IPv4/IPv6 addressesipv4only - if true the List will only contain IPv4
addresses, otherwise only IPv6 addresses will be contained
Collectionpublic static Collection<InetAddress> sortInetAddresses(Collection<InetAddress> in)
Orders the elements of the given Collection. The input
Collection will not be modified, instead a new Collection
is returned. Output order is as followed:
in - Collection of addresses to reorder
Collection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||