public static InetAddress forUriString ( String hostAddr ) { InetAddress addr = forUriStringNoThrow ( hostAddr ) ; if ( addr == null ) { throw formatIllegalArgumentException ( "Not a valid URI IP literal: '%s'" , hostAddr ) ; } return addr ; }
Returns an InetAddress representing the literal IPv4 or IPv6 host portion of a URL encoded in the format specified by RFC 3986 section 3 . 2 . 2 .