code: public static String resourceTypeFromResourceId(String id) {
          return (id != null) ? ResourceId.fromString(id).resourceType() : null;
      }
docs: Extract resource type from a resource ID string.
  @param id the resource ID string
  @return the resource type