docs: public String exportAliasesAsCsv(CmsObject cms) throws CmsException {
  
          String siteRoot = cms.getRequestContext().getSiteRoot();
          List<CmsAlias> aliases = OpenCms.getAliasManager().getAliasesForSite(cms, siteRoot);
          StringWriter writer = new StringWriter();
          CSVWriter csvWriter = new CSVWriter(writer);
          StringBuffer resultBuffer = writer.getBuffer();
          for (CmsAlias alias : aliases) {
              try {
                  CmsResource resource = cms.readResource(alias.getStructureId());
                  csvWriter.writeNext(
                      new String[] {alias.getAliasPath(), cms.getSitePath(resource), alias.getMode().toString()});
              } catch (CmsException e) {
                  LOG.warn("Could not read alias resource", e);
                  continue;
              }
          }
  
          List<CmsRewriteAlias> rewriteAliases = OpenCms.getAliasManager().getRewriteAliases(cms, siteRoot);
          for (CmsRewriteAlias rewrite : rewriteAliases) {
              csvWriter.writeNext(
                  new String[] {
                      rewrite.getPatternString(),
                      rewrite.getReplacementString(),
                      rewrite.getMode().toString(),
                      "rewrite"});
          }
          try {
              csvWriter.flush();
              csvWriter.close();
          } catch (IOException e) {
              // can't happen
          }
          return resultBuffer.toString();
      }