code: public File generate(File outputDir, boolean pack, Properties properties) throws IOException {
          if (result == null) {
              throw new IllegalStateException("Check policies result is null");
          }
  
          // prepare working directory
          File workDir = new File(outputDir, "whitesource");
          File reportFile = workDir;
          if (!workDir.exists() && !workDir.mkdir()) {
              throw new IOException("Unable to make output directory: " + workDir);
          }
  
          // create actual report
          VelocityEngine engine = createTemplateEngine(properties);
          VelocityContext context = createTemplateContext();
          FileWriter fw = new FileWriter(new File(workDir, "index.html"));
          try {
              engine.mergeTemplate(TEMPLATE_FOLDER + TEMPLATE_FILE, "UTF-8", context, fw);
              fw.flush();
          } finally {
              FileUtils.close(fw);
          }
  
          // copy resources
          copyReportResources(workDir);
  
          // package report into a zip archive
          if (pack) {
              reportFile = new File(outputDir, "whitesource.zip");
              ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(reportFile));
              FileUtils.packDirectory(workDir, zos);
              FileUtils.deleteRecursive(workDir);
          }
  
          return reportFile;
      }
docs: The method generate the policy check report
  
  @param outputDir Directory where report files will be created.
  @param pack      <code>True</code> to create a zip file from the resulting directory.
  @param properties Properties for template engine.
  
  @return  File reference to the resulting report.
  
  @throws IOException In case of errors during report generation process.