code: public void setFile(File file) {
      String fileName = file.getName().toLowerCase(Locale.ROOT);
      if (fileName.matches(".*\\.htm(l)?$")) {
        method = OutputMethod.HTML;
      } else {
        if (fileName.matches(".*\\.jsonp")) {
          method = OutputMethod.JSONP;
        } else {
          method = OutputMethod.JSON;
        }
      }
      this.targetFile = file;
    }
docs: Output file for the report file. The name of the output file
  will also trigger how the report is written. If the name of the
  output file ends with ".htm(l)?" then the output file is a HTML
  file and CSS/JS scaffolding is also written to visualize the JSON
  model.
  
  If the name of the file ends with ".json(p)?" a JSON file is written.