docs: protected void scrubResource(
          CmsObject cms,
          CmsPublishedResource res,
          Set<String> scrubbedFolders,
          Set<String> scrubbedFiles) {
  
          long timer = System.currentTimeMillis();
          if (LOG.isDebugEnabled()) {
              LOG.debug(Messages.get().getBundle().key(Messages.LOG_SCRUB_EXPORT_START_RESOURCE_1, res.getRootPath()));
          }
          try {
              // ensure all siblings are scrubbed if the resource has one
              String resPath = cms.getRequestContext().removeSiteRoot(res.getRootPath());
              List<String> siblings = getSiblingsList(cms, resPath);
  
              for (String vfsName : siblings) {
  
                  // get the link name for the published file
                  String rfsName = OpenCms.getStaticExportManager().getRfsName(cms, vfsName);
                  if (LOG.isDebugEnabled()) {
                      LOG.debug(Messages.get().getBundle().key(Messages.LOG_CHECKING_STATIC_EXPORT_2, vfsName, rfsName));
                  }
                  if (rfsName.startsWith(OpenCms.getStaticExportManager().getRfsPrefix(vfsName))
                      && (!scrubbedFiles.contains(rfsName))
                      && (!scrubbedFolders.contains(CmsResource.getFolderPath(rfsName)))) {
  
                      if (res.isFolder()) {
                          if (res.getState().isDeleted()) {
                              String exportFolderName = CmsFileUtil.normalizePath(
                                  OpenCms.getStaticExportManager().getExportPath(vfsName)
                                      + rfsName.substring(
                                          OpenCms.getStaticExportManager().getRfsPrefix(vfsName).length()));
                              try {
                                  File exportFolder = new File(exportFolderName);
                                  // check if export folder exists, if so delete it
                                  if (exportFolder.exists() && exportFolder.canWrite()) {
                                      CmsFileUtil.purgeDirectory(exportFolder);
                                      // write log message
                                      if (LOG.isInfoEnabled()) {
                                          LOG.info(
                                              Messages.get().getBundle().key(
                                                  Messages.LOG_FOLDER_DELETED_1,
                                                  exportFolderName));
                                      }
                                      scrubbedFolders.add(rfsName);
                                      continue;
                                  }
                              } catch (Throwable t) {
                                  // ignore, nothing to do about this
                                  if (LOG.isWarnEnabled()) {
                                      LOG.warn(
                                          Messages.get().getBundle().key(
                                              Messages.LOG_FOLDER_DELETION_FAILED_2,
                                              vfsName,
                                              exportFolderName));
                                  }
                              }
                          }
                      } else {
                          // check if the file is the default file of the folder
                          try {
                              CmsResource defaultFile = cms.readDefaultFile(CmsResource.getFolderPath(vfsName));
                              if (defaultFile != null) {
                                  String defaultfilePath = cms.getRequestContext().removeSiteRoot(
                                      defaultFile.getRootPath());
                                  if (vfsName.equals(defaultfilePath)) {
                                      // this is the default file, remove it additionally if present
                                      String rfsNameDefault = CmsResource.getFolderPath(rfsName)
                                          + CmsStaticExportManager.EXPORT_DEFAULT_FILE;
                                      String rfsExportFileName = CmsFileUtil.normalizePath(
                                          OpenCms.getStaticExportManager().getExportPath(vfsName)
                                              + rfsNameDefault.substring(
                                                  OpenCms.getStaticExportManager().getRfsPrefix(vfsName).length()));
  
                                      purgeFile(rfsExportFileName, vfsName);
                                  }
                              }
                          } catch (CmsException e) {
                              // failed to determine default file
                          }
                      }
  
                      // add index_export.html or the index.html to the folder name
                      rfsName = OpenCms.getStaticExportManager().addDefaultFileNameToFolder(rfsName, res.isFolder());
                      if (LOG.isDebugEnabled()) {
                          LOG.debug(Messages.get().getBundle().key(Messages.LOG_RFSNAME_1, rfsName));
                      }
                      String rfsExportFileName = CmsFileUtil.normalizePath(
                          OpenCms.getStaticExportManager().getExportPath(vfsName)
                              + rfsName.substring(OpenCms.getStaticExportManager().getRfsPrefix(vfsName).length()));
                      if (LOG.isDebugEnabled()) {
                          LOG.debug(Messages.get().getBundle().key(Messages.LOG_EXPORT_RFSNAME_1, rfsName));
                      }
                      // purge related files
                      List<File> relFilesToPurge = getRelatedFilesToPurge(rfsExportFileName, vfsName);
                      purgeFiles(relFilesToPurge, vfsName, scrubbedFiles);
  
                      if (!res.isFolder()) {
                          I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(res.getType());
                          I_CmsResourceLoader resLoader = OpenCms.getResourceManager().getLoader(resType.getLoaderId());
                          if ((resLoader instanceof CmsXmlContentLoader)
                              && !(resLoader instanceof CmsXmlContainerPageLoader)) {
  
                              // only execute for XML content that are no container pages
                              List<File> detailPageFiles = getDetailPageFiles(cms, res, vfsName);
                              purgeFiles(detailPageFiles, vfsName, scrubbedFiles);
                              if (LOG.isDebugEnabled()) {
                                  LOG.debug(Messages.get().getBundle().key(Messages.LOG_PURGED_DETAILPAGES_0));
                              }
                              List<File> referencingContainerPages = getContainerPagesToPurge(cms, res.getStructureId());
                              purgeFiles(referencingContainerPages, vfsName, scrubbedFiles);
                              if (LOG.isDebugEnabled()) {
                                  LOG.debug(Messages.get().getBundle().key(Messages.LOG_PURGED_CONTAINERPAGES_0));
                              }
                          }
                      }
                      // purge the file itself
                      purgeFile(rfsExportFileName, vfsName);
                      scrubbedFiles.add(rfsName);
                  }
              }
          } catch (Throwable e) {
              LOG.error(e.getLocalizedMessage(), e);
          }
          if (LOG.isDebugEnabled()) {
              LOG.debug(
                  Messages.get().getBundle().key(
                      Messages.LOG_SCRUB_EXPORT_FINISH_RESOURCE_2,
                      res.getRootPath(),
                      (System.currentTimeMillis() - timer) + ""));
          }
      }