Reputation: 2565
Now that all sun.* proprietary APIs may be removed in the future, does anyone know any open source Java implementation of IPv6 validation?
Regarding this question, it'd be also nice to have native ipv6-address/prefix-length format support to.
Upvotes: 3
Views: 617
Reputation: 4595
The open-source IPAddress Java library will validate both IPv6 and IPv4 and also supports prefix-length (and validation of such). I am the project manager of that library.
Use
try {
IPAddressString str = new IPAddressString("::1");
IPAddress addr = str.toAddress();
} catch(IPAddressStringException e) {
//e.getMessage has validation error
}
Upvotes: 1