code: public List<CmsPublishedResource> scrubExportFolders(CmsUUID publishHistoryId) {
  
          if (LOG.isDebugEnabled()) {
              LOG.debug(Messages.get().getBundle().key(Messages.LOG_SCRUBBING_EXPORT_FOLDERS_1, publishHistoryId));
          }
  
          Set<String> scrubbedFolders = new HashSet<String>();
          Set<String> scrubbedFiles = new HashSet<String>();
  
          // get a export user cms context
          CmsObject cms;
          try {
              // this will always use the root site
              cms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserExport());
          } catch (CmsException e) {
              // this should never happen
              LOG.error(Messages.get().getBundle().key(Messages.LOG_INIT_FAILED_0), e);
              return Collections.emptyList();
          }
  
          List<CmsPublishedResource> publishedResources;
          try {
              publishedResources = cms.readPublishedResources(publishHistoryId);
          } catch (CmsException e) {
              LOG.error(
                  Messages.get().getBundle().key(Messages.LOG_READING_CHANGED_RESOURCES_FAILED_1, publishHistoryId),
                  e);
              return Collections.emptyList();
          }
  
          publishedResources = addMovedLinkSources(cms, publishedResources);
  
          // now iterate the actual resources to be exported
          Iterator<CmsPublishedResource> itPubRes = publishedResources.iterator();
          while (itPubRes.hasNext()) {
              CmsPublishedResource res = itPubRes.next();
              if (res.getState().isUnchanged()) {
                  // unchanged resources don't need to be deleted
                  continue;
              }
  
              scrubResource(cms, res, scrubbedFolders, scrubbedFiles);
          }
          return publishedResources;
      }
docs: Scrubs all files from the export folder that might have been changed,
  so that the export is newly created after the next request to the resource.<p>
  
  @param publishHistoryId id of the last published project
  
  @return the list of {@link CmsPublishedResource} objects to export