code: public static void writeAnalysisHTMLToFile(String outputPath, DataAnalysis dataAnalysis, JavaSparkContext sc) {
          try {
              String analysisAsHtml = HtmlAnalysis.createHtmlAnalysisString(dataAnalysis);
              writeStringToFile(outputPath, analysisAsHtml, sc);
          } catch (Exception e) {
              throw new RuntimeException("Error generating or writing HTML analysis file (normalized data)", e);
          }
      }
docs: Write a DataAnalysis to HDFS (or locally) as a HTML file
  
  @param outputPath      Output path
  @param dataAnalysis    Analysis to generate HTML file for
  @param sc              Spark context