code: private void replacePath(String sourceModulePath, String targetModulePath, List<CmsResource> resources)
      throws CmsException, UnsupportedEncodingException {
  
          for (CmsResource resource : resources) {
              if (resource.isFile()) {
                  CmsFile file = getCms().readFile(resource);
                  if (CmsResourceTypeXmlContent.isXmlContent(file)) {
                      CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(getCms(), file);
                      xmlContent.setAutoCorrectionEnabled(true);
                      file = xmlContent.correctXmlStructure(getCms());
                  }
                  String encoding = CmsLocaleManager.getResourceEncoding(getCms(), file);
                  String oldContent = new String(file.getContents(), encoding);
                  String newContent = oldContent.replaceAll(sourceModulePath, targetModulePath);
                  Matcher matcher = Pattern.compile(CmsUUID.UUID_REGEX).matcher(newContent);
                  newContent = matcher.replaceAll("");
                  newContent = newContent.replaceAll("<uuid></uuid>", "");
                  if (!oldContent.equals(newContent)) {
                      file.setContents(newContent.getBytes(encoding));
                      if (!resource.getRootPath().startsWith(CmsWorkplace.VFS_PATH_SYSTEM)) {
                          if (lockResource(getCms(), resource)) {
                              getCms().writeFile(file);
                          }
                      } else {
                          getCms().writeFile(file);
                      }
                  }
              }
          }
      }
docs: Replaces the paths within all the given resources and removes all UUIDs by an regex.<p>
  
  @param sourceModulePath the search path
  @param targetModulePath the replace path
  @param resources the resources
  
  @throws CmsException if something goes wrong
  @throws UnsupportedEncodingException if the file content could not be read with the determined encoding