Parse an authority into a URI for retrieving the host and port.
(String authority)
| 515 | * Parse an authority into a URI for retrieving the host and port. |
| 516 | */ |
| 517 | public static URI authorityToUri(String authority) { |
| 518 | Preconditions.checkNotNull(authority, "authority"); |
| 519 | URI uri; |
| 520 | try { |
| 521 | uri = new URI(null, authority, null, null, null); |
| 522 | } catch (URISyntaxException ex) { |
| 523 | throw new IllegalArgumentException("Invalid authority: " + authority, ex); |
| 524 | } |
| 525 | return uri; |
| 526 | } |
| 527 | |
| 528 | /** |
| 529 | * Verify {@code authority} is valid for use with gRPC. The syntax must be valid and it must not |
no test coverage detected