docs: private byte[] replaceInContent(
          CmsObject cmsObject,
          I_CmsReport report,
          CmsFile file,
          byte[] contents,
          boolean replace)
      throws Exception {
  
          if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_settings.getLocale())) {
              Locale contentLocale = CmsLocaleManager.getMainLocale(cmsObject, file);
              if (!contentLocale.toString().equalsIgnoreCase(m_settings.getLocale())) {
                  // content does not match the requested locale, skip it
                  report.println(
                      Messages.get().container(Messages.RPT_SOURCESEARCH_NOT_MATCHED_0),
                      I_CmsReport.FORMAT_NOTE);
                  return null;
              }
          }
  
          String encoding = CmsLocaleManager.getResourceEncoding(cmsObject, file);
          String content = new String(contents, encoding);
  
          Matcher matcher;
          matcher = Pattern.compile(m_settings.getSearchpattern()).matcher(content);
          if (matcher.find()) {
              // search pattern did match here, so take this file in the list with matches resources
              m_matchedResources.add(file);
              report.println(Messages.get().container(Messages.RPT_SOURCESEARCH_MATCHED_0), I_CmsReport.FORMAT_OK);
              if (replace) {
                  return matcher.replaceAll(m_settings.getReplacepattern()).getBytes(encoding);
              }
          } else {
              // search pattern did not match
              report.println(Messages.get().container(Messages.RPT_SOURCESEARCH_NOT_MATCHED_0), I_CmsReport.FORMAT_NOTE);
          }
          return null;
      }