code: protected boolean isDetailPageLinkSecure(
          CmsObject cms,
          String detailPage,
          CmsResource detailContent,
          CmsSite targetSite,
          boolean secureRequest) {
  
          boolean result = false;
          CmsStaticExportManager exportManager = OpenCms.getStaticExportManager();
          try {
              cms = OpenCms.initCmsObject(cms);
              if (targetSite.getSiteRoot() != null) {
                  cms.getRequestContext().setSiteRoot(targetSite.getSiteRoot());
              }
              CmsResource defaultFile = cms.readDefaultFile(detailPage);
              if (defaultFile != null) {
                  result = exportManager.isSecureLink(cms, defaultFile.getRootPath(), "", secureRequest);
              }
          } catch (Exception e) {
              LOG.error("Error while checking whether detail page link should be secure: " + e.getLocalizedMessage(), e);
          }
          return result;
      }
docs: Checks whether a link to a detail page should be secure.<p>
  
  @param cms the current CMS context
  @param detailPage the detail page path
  @param detailContent the detail content resource
  @param targetSite the target site containing the detail page
  @param secureRequest true if the currently running request is secure
  
  @return true if the link should be a secure link