public static String[] splitPath(String path) {
    path = path.startsWith("/") ? path.substring(1) : path;
    return path.split("/", 4);
  }
Splits the provided path into its components, handling potential leading slashes.

@param path The request path.
@return An array of path segments.
ambry-api/src/main/java/com/github/ambry/rest/RestUtils.java