docs: public static void checkCreateContent(CmsObject cms, CmsUgcConfiguration config) throws CmsUgcException {
  
          if (config.getMaxContentNumber().isPresent()) {
              int maxContents = config.getMaxContentNumber().get().intValue();
              String sitePath = cms.getSitePath(config.getContentParentFolder());
              try {
                  if (cms.getFilesInFolder(sitePath).size() >= maxContents) {
  
                      String message = Messages.get().getBundle(cms.getRequestContext().getLocale()).key(
                          Messages.ERR_TOO_MANY_CONTENTS_1,
                          config.getContentParentFolder());
                      throw new CmsUgcException(CmsUgcConstants.ErrorCode.errMaxContentsExceeded, message);
                  }
              } catch (CmsException e) {
                  LOG.error(e.getLocalizedMessage(), e);
                  throw new CmsUgcException(e);
              }
          }
      }