public class NetworkUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
canonize(String ipv6Address)
Convert IPv6 adress into RFC 5952 form.
|
static boolean |
checkForMac() |
static String |
formatAddress(InetAddress inet)
Formats input address.
|
static String |
formatAddress(InetSocketAddress inet)
Converts socket address into string literal, which has form: 'address:port'.
|
static String |
formatPossibleIpv6Address(String address) |
static boolean |
isBindingToMulticastDressSupported() |
public static String canonize(String ipv6Address) throws IllegalArgumentException
Convert IPv6 adress into RFC 5952 form. E.g. 2001:db8:0:1:0:0:0:1 -> 2001:db8:0:1::1
Method is null safe, and if IPv4 address or host name is passed to the method it is returned wihout any processing.
Method also supports IPv4 in IPv6 (e.g. 0:0:0:0:0:ffff:192.0.2.1 -> ::ffff:192.0.2.1), and zone ID (e.g. fe80:0:0:0:f0f0:c0c0:1919:1234%4 -> fe80::f0f0:c0c0:1919:1234%4).
ipv6Address
- String representing valid IPv6 address.IllegalArgumentException
- if IPv6 format is unacceptable.public static String formatAddress(InetAddress inet)
inet
- public static String formatAddress(InetSocketAddress inet)
inet
- public static boolean isBindingToMulticastDressSupported()
public static boolean checkForMac()
Copyright © 2016 JBoss by Red Hat. All rights reserved.