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

Method getPathSegments

api/src/main/java/io/grpc/Uri.java:497–502  ·  view source on GitHub ↗

Returns this URI's path as a list of path segments not including the '/' segment delimiters. Prefer this method over #getPath() because it preserves the distinction between segment separators and literal '/'s within a path segment. A trailing '/' delimiter in the path results in the

()

Source from the content-addressed store, hash-verified

495 * <p>The returned list is immutable.
496 */
497 public List<String> getPathSegments() {
498 // Returned list must be immutable but we intentionally keep guava out of the public API.
499 ImmutableList.Builder<String> segmentsBuilder = ImmutableList.builder();
500 parseAssumedUtf8PathIntoSegments(path, segmentsBuilder);
501 return segmentsBuilder.build();
502 }
503
504 /**
505 * Returns true iff this URI's path component starts with a path segment (rather than the '/'

Calls 3

buildMethod · 0.65
builderMethod · 0.45