docs: protected int exportTemplateResource(CmsStaticExportData data, StringBuffer cookies) throws IOException {
  
          String vfsName = data.getVfsName();
          String rfsName = data.getRfsName();
          CmsStaticExportManager manager = OpenCms.getStaticExportManager();
  
          String exportUrlStr;
          if (rfsName.contains(manager.getRfsPrefix(vfsName))) {
              LOG.info("rfsName " + rfsName + " contains rfsPrefix " + manager.getRfsPrefix(vfsName));
              exportUrlStr = manager.getExportUrl() + rfsName;
          } else {
              exportUrlStr = manager.getExportUrl() + manager.getRfsPrefix(vfsName) + rfsName;
          }
          if (LOG.isDebugEnabled()) {
              LOG.debug(Messages.get().getBundle().key(Messages.LOG_SENDING_REQUEST_2, rfsName, exportUrlStr));
          }
          // setup the connection and request the resource
          URL exportUrl = new URL(exportUrlStr);
          HttpURLConnection.setFollowRedirects(false);
          HttpURLConnection urlcon = (HttpURLConnection)exportUrl.openConnection();
          // set request type to GET
          urlcon.setRequestMethod(REQUEST_METHOD_GET);
          // add special export header
          urlcon.setRequestProperty(CmsRequestUtil.HEADER_OPENCMS_EXPORT, CmsStringUtil.TRUE);
          // add additional headers if available
          if (manager.getAcceptLanguageHeader() != null) {
              urlcon.setRequestProperty(CmsRequestUtil.HEADER_ACCEPT_LANGUAGE, manager.getAcceptLanguageHeader());
          } else {
              urlcon.setRequestProperty(CmsRequestUtil.HEADER_ACCEPT_LANGUAGE, manager.getDefaultAcceptLanguageHeader());
          }
          if (manager.getAcceptCharsetHeader() != null) {
              urlcon.setRequestProperty(CmsRequestUtil.HEADER_ACCEPT_CHARSET, manager.getAcceptCharsetHeader());
          } else {
              urlcon.setRequestProperty(CmsRequestUtil.HEADER_ACCEPT_CHARSET, manager.getDefaultAcceptCharsetHeader());
          }
  
          // get the last modified date and add it to the request
          String exportFileName = CmsFileUtil.normalizePath(manager.getExportPath(vfsName) + rfsName);
          File exportFile = new File(exportFileName);
          long dateLastModified = exportFile.lastModified();
          // system folder case
          if (vfsName.startsWith(CmsWorkplace.VFS_PATH_SYSTEM) || OpenCms.getSiteManager().startsWithShared(vfsName)) {
              // iterate over all rules
              Iterator<CmsStaticExportRfsRule> it = manager.getRfsRules().iterator();
              while (it.hasNext()) {
                  CmsStaticExportRfsRule rule = it.next();
                  if (rule.match(vfsName)) {
                      exportFileName = CmsFileUtil.normalizePath(rule.getExportPath() + rfsName);
                      exportFile = new File(exportFileName);
                      if (dateLastModified > exportFile.lastModified()) {
                          dateLastModified = exportFile.lastModified();
                      }
                  }
              }
          }
          urlcon.setIfModifiedSince(dateLastModified);
          if (LOG.isDebugEnabled()) {
              LOG.debug(
                  Messages.get().getBundle().key(
                      Messages.LOG_IF_MODIFIED_SINCE_SET_2,
                      exportFile.getName(),
                      new Long((dateLastModified / 1000) * 1000)));
          }
          if (cookies.length() > 0) {
              // set the cookies, included the session id to keep the same session
              urlcon.setRequestProperty(REQUEST_PROPERTY_COOKIE, cookies.toString());
          }
  
          // now perform the request
          urlcon.connect();
          int status = urlcon.getResponseCode();
  
          if (cookies.length() == 0) {
              //Now retrieve the cookies. The jsessionid is here
              cookies.append(urlcon.getHeaderField(HEADER_FIELD_SET_COOKIE));
              if (LOG.isDebugEnabled()) {
                  LOG.debug(Messages.get().getBundle().key(Messages.LOG_STATICEXPORT_COOKIES_1, cookies));
              }
          }
          urlcon.disconnect();
          if (LOG.isInfoEnabled()) {
              LOG.info(
                  Messages.get().getBundle().key(
                      Messages.LOG_REQUEST_RESULT_3,
                      rfsName,
                      exportUrlStr,
                      new Integer(status)));
          }
          return status;
      }