docs: private void collectFolder(String sourceMergeFolder, String targetMergefolder, int currentFolder)
      throws CmsException {
  
          //get the list of all resources in the source merge folder
          int xmlPageId = OpenCms.getResourceManager().getResourceType(
              CmsResourceTypeXmlPage.getStaticTypeName()).getTypeId();
          CmsResourceFilter filter = CmsResourceFilter.IGNORE_EXPIRATION.addRequireType(xmlPageId);
          List folderResources = m_cms.readResources(sourceMergeFolder, filter, true);
          Iterator i = folderResources.iterator();
          int size = folderResources.size();
          // now loop through all resources and check them against those in the target merge folder
          m_report.println(
              Messages.get().container(Messages.RPT_SCAN_PAGES_IN_FOLDER_BEGIN_2, sourceMergeFolder, new Integer(size)),
              I_CmsReport.FORMAT_HEADLINE);
          int count = 1;
          while (i.hasNext()) {
              CmsResource res = (CmsResource)i.next();
              String resName = m_cms.getSitePath(res);
  
              m_report.print(
                  org.opencms.report.Messages.get().container(
                      org.opencms.report.Messages.RPT_SUCCESSION_2,
                      String.valueOf(count++),
                      String.valueOf(size)),
                  I_CmsReport.FORMAT_NOTE);
              m_report.println(Messages.get().container(Messages.RPT_PROCESS_1, resName), I_CmsReport.FORMAT_NOTE);
  
              // now analyse the page and calculate the action to do
              int action = analyse(res, sourceMergeFolder, targetMergefolder, currentFolder);
              // add the name of the resource to the correct list
              switch (action) {
                  case FOLDER1_EXCLUSIVE:
                      m_folder1Exclusive.add(resName);
                      m_report.println(Messages.get().container(Messages.RPT_FOLDER1_EXCLUSIVE_0), I_CmsReport.FORMAT_OK);
                      break;
                  case FOLDER2_EXCLUSIVE:
                      m_folder2Exclusive.add(resName);
                      m_report.println(Messages.get().container(Messages.RPT_FOLDER2_EXCLUSIVE_0), I_CmsReport.FORMAT_OK);
                      break;
                  case FOLDERS_SIBLING:
                      if (!m_foldersSibling.contains(
                          getResourceNameInOtherFolder(resName, sourceMergeFolder, targetMergefolder))) {
                          m_foldersSibling.add(resName);
                      }
                      m_report.println(Messages.get().container(Messages.RPT_FOLDERS_SIBLING_0), I_CmsReport.FORMAT_OK);
                      break;
                  case FOLDERS_EQUALNAMES:
                      if (!m_foldersEqualnames.contains(
                          getResourceNameInOtherFolder(resName, sourceMergeFolder, targetMergefolder))) {
                          m_foldersEqualnames.add(resName);
                      }
                      m_report.println(
                          Messages.get().container(Messages.RPT_FOLDERS_EQUALNAMES_0),
                          I_CmsReport.FORMAT_OK);
                      break;
                  case FOLDERS_DIFFERENTTYPES:
                      if (!m_foldersDifferenttypes.contains(
                          getResourceNameInOtherFolder(resName, sourceMergeFolder, targetMergefolder))) {
                          m_foldersDifferenttypes.add(resName);
                      }
                      m_report.println(
                          Messages.get().container(Messages.RPT_FOLDERS_DIFFERENTTYPES_0),
                          I_CmsReport.FORMAT_OK);
                      break;
                  default:
                      break;
              }
              res = null;
          }
          folderResources = null;
          m_report.println(
              Messages.get().container(Messages.RPT_SCAN_PAGES_IN_FOLDER_END_0),
              I_CmsReport.FORMAT_HEADLINE);
  
      }