public static String stripSlashAndExtensionFromId(String blobIdWithExtension) {
    int extensionIndex = blobIdWithExtension.indexOf(".");
    int startIndex = blobIdWithExtension.startsWith("/") ? 1 : 0;
    int endIndex = extensionIndex != -1 ? extensionIndex : blobIdWithExtension.length();
    return blobIdWithExtension.substring(startIndex, endIndex);
  }
Drops the leading slash and extension (if any) in the blob ID.
@param blobIdWithExtension the blob ID possibly with an extension.
@return {@code blobIdWithExtension} without an extension if there was one.
ambry-api/src/main/java/com/github/ambry/rest/RestUtils.java