docs: protected void addParentFolders(String resourceName) throws CmsImportExportException, SAXException {
  
          try {
              // this is a resource in /system/ folder and option includeSystem is not true
              if (!checkExportResource(resourceName)) {
                  return;
              }
  
              // Initialize the "previously added folder cache"
              if (m_superFolders == null) {
                  m_superFolders = new ArrayList<String>();
              }
              List<String> superFolders = new ArrayList<String>();
              String currentSubFolder = resourceName;
  
              // Check, if the path is really a folder
              boolean isFolderResource = currentSubFolder.endsWith("/");
  
              while (currentSubFolder.length() > "/".length()) {
                  currentSubFolder = currentSubFolder.substring(0, currentSubFolder.length() - 1);
                  currentSubFolder = currentSubFolder.substring(0, currentSubFolder.lastIndexOf("/") + 1);
                  if (currentSubFolder.length() <= "/".length()) {
                      break;
                  }
                  superFolders.add(currentSubFolder);
              }
              for (int i = superFolders.size() - 1; i >= 0; i--) {
                  String addFolder = superFolders.get(i);
                  if (!m_superFolders.contains(addFolder)) {
                      // This super folder was NOT added previously. Add it now!
                      CmsFolder folder = getCms().readFolder(addFolder, CmsResourceFilter.IGNORE_EXPIRATION);
                      appendResourceToManifest(folder, false, true);
                      // Remember that this folder was added
                      m_superFolders.add(addFolder);
                  }
              }
              if (isFolderResource) { // add the folder itself
                  if (!m_superFolders.contains(resourceName)) {
                      // This super folder was NOT added previously. Add it now!
                      CmsFolder folder = getCms().readFolder(resourceName, CmsResourceFilter.IGNORE_EXPIRATION);
                      appendResourceToManifest(folder, false);
                      // Remember that this folder was added
                      m_superFolders.add(resourceName);
                  }
              }
          } catch (CmsImportExportException e) {
  
              throw e;
          } catch (CmsException e) {
  
              CmsMessageContainer message = Messages.get().container(
                  Messages.ERR_IMPORTEXPORT_ERROR_ADDING_PARENT_FOLDERS_1,
                  resourceName);
              if (LOG.isDebugEnabled()) {
                  LOG.debug(message.key(), e);
              }
  
              throw new CmsImportExportException(message, e);
          }
      }