code: public static @NotNull String mangleNamespaces(@NotNull String path) {
      if (!StringUtils.contains(path, NAMESPACE_SEPARATOR)) {
        return path;
      }
      Matcher matcher = NAMESPACE_PATTERN.matcher(path);
      StringBuffer sb = new StringBuffer();
      while (matcher.find()) {
        String replacement = MANGLED_NAMESPACE_PREFIX + matcher.group(1) + MANGLED_NAMESPACE_SUFFIX;
        matcher.appendReplacement(sb, replacement);
      }
      matcher.appendTail(sb);
      return sb.toString();
    }
docs: Mangle the namespaces in the given path for usage in sling-based URLs.
  <p>
  Example: /path/jcr:content to /path/_jcr_content
  </p>
  @param path Path to mangle
  @return Mangled path