MCPcopy Create free account
hub / github.com/grpc/grpc-java / authorityToUri

Method authorityToUri

core/src/main/java/io/grpc/internal/GrpcUtil.java:517–526  ·  view source on GitHub ↗

Parse an authority into a URI for retrieving the host and port.

(String authority)

Source from the content-addressed store, hash-verified

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

Callers 4

checkAuthorityMethod · 0.95
getOverridenHostMethod · 0.95
getOverridenPortMethod · 0.95
parseAuthorityMethod · 0.95

Calls 1

checkNotNullMethod · 0.80

Tested by

no test coverage detected