code: public static void validateContentId(String contentID)
          throws InvalidIdException {
          if (contentID == null) {
              String err = "Content ID must be at least 1 character long";
              throw new InvalidIdException(err);
          }
  
          if (contentID.contains("?")) {
              String err = "Content ID may not include the '?' character";
              throw new InvalidIdException(err);
          }
  
          if (contentID.contains("\\")) {
              String err = "Content ID may not include the '\\' character";
              throw new InvalidIdException(err);
          }
  
          int utfLength;
          int urlLength;
          try {
              utfLength = contentID.getBytes("UTF-8").length;
              String urlEncoded = URLEncoder.encode(contentID, "UTF-8");
              urlLength = urlEncoded.getBytes("UTF-8").length;
          } catch (UnsupportedEncodingException e) {
              throw new RuntimeException(e);
          }
  
          if (utfLength > 1024 || urlLength > 1024) {
              String err =
                  "Content ID must <= 1024 bytes after URL and UTF-8 encoding";
              throw new InvalidIdException(err);
          }
      }
docs: Determines if the ID of the content to be added is valid
  
  @throws InvalidIdException if not valid