code: private void replaceModuleName() throws CmsException, UnsupportedEncodingException {
  
          CmsResourceFilter filter = CmsResourceFilter.ALL.addRequireFile().addExcludeState(
              CmsResource.STATE_DELETED).addRequireTimerange().addRequireVisible();
          List<CmsResource> resources = getCms().readResources(
              CmsWorkplace.VFS_PATH_MODULES + m_cloneInfo.getName() + "/",
              filter);
          for (CmsResource resource : resources) {
              CmsFile file = getCms().readFile(resource);
              if (CmsResourceTypeXmlContent.isXmlContent(file)) {
                  CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(getCms(), file);
                  xmlContent.setAutoCorrectionEnabled(true);
                  file = xmlContent.correctXmlStructure(getCms());
              }
              byte[] contents = file.getContents();
              String encoding = CmsLocaleManager.getResourceEncoding(getCms(), file);
              String content = new String(contents, encoding);
              Matcher matcher = Pattern.compile(m_cloneInfo.getSourceModuleName()).matcher(content);
              if (matcher.find()) {
                  contents = matcher.replaceAll(m_cloneInfo.getName()).getBytes(encoding);
                  if (lockResource(getCms(), file)) {
                      file.setContents(contents);
                      getCms().writeFile(file);
                  }
              }
          }
      }
docs: Initializes a thread to find and replace all occurrence of the module's path.<p>
  
  @throws CmsException in case writing the file fails
  @throws UnsupportedEncodingException in case of the wrong encoding