code: public static CmsJspContentAttachmentsBean getAttachmentsForLocale(
          CmsObject cms,
          CmsResource content,
          String locale) {
  
          Optional<CmsResource> detailOnly = CmsDetailOnlyContainerUtil.getDetailOnlyPage(cms, content, locale);
          if (!detailOnly.isPresent()) {
              return new CmsJspContentAttachmentsBean();
          } else {
              try {
                  return new CmsJspContentAttachmentsBean(cms, detailOnly.get());
              } catch (Exception e) {
                  LOG.error(e.getLocalizedMessage(), e);
                  return new CmsJspContentAttachmentsBean();
              }
          }
      }
docs: Loads the attachments for a given content.<p>
  
  @param cms the CMS context
  @param content the content
  @param locale the locale
  
  @return the attachment bean for the given content and locale