public IPAddressName(String name) throws IOException {
  if (name == null || name.length() == 0) {
    throw new IOException("IPAddress cannot be null or empty");
  }
  if (name.charAt(name.length() - 1) == '/') {
    throw new IOException("Invalid IPAddress: " + name);
  }
  if (name.indexOf(':') >= 0) {
    parseIPv6(name);
    isIPv4=false;
  }
 else   if (name.indexOf('.') >= 0) {
    parseIPv4(name);
    isIPv4=true;
  }
 else {
    throw new IOException("Invalid IPAddress: " + name);
  }
}

public IPAddressName ( String name ) throws IOException { if ( name == null || name . length ( ) == 0 ) { throw new IOException ( "IPAddress cannot be null or empty" ) ; } if ( name . charAt ( name . length ( ) - 1 ) == '/' ) { throw new IOException ( "Invalid IPAddress: " + name ) ; } if ( name . indexOf ( ':' ) >= 0 ) { parseIPv6 ( name ) ; isIPv4 = false ; } else if ( name . indexOf ( '.' ) >= 0 ) { parseIPv4 ( name ) ; isIPv4 = true ; } else { throw new IOException ( "Invalid IPAddress: " + name ) ; } }
create an ipaddressname from a string . [ ietf rfc1338 supernetting & ietf rfc1519 classless inter - domain routing ( cidr ) ] for ipv4 addresses , the forms are " b1 . b2 . b3 . b4 " or " b1 . b2 . b3 . b4 / m1 . m2 . m3 . m4 " , where b1 - b4 are decimal byte values 0 - 255 and m1 - m4 are decimal mask values 0 - 255 . < p > [ ietf rfc2373 ip version 6 addressing architecture ] for ipv6 addresses , the forms are " a1 : a2 : . . . : a8 " or " a1 : a2 : . . . : a8 / n " , where a1 - a8 are hexadecimal values representing the eight 16 - bit pieces of the address . if / n is used , n is a decimal number indicating how many of the leftmost contiguous bits of the address comprise the prefix for this subnet . internally , a mask value is created using the prefix length . < p >
