code: @Override
     public final int buildReport(String[] args) throws Exception {
  
        if (!initSettings(args)) {
           return EXITNOSETTINGS;
        }
  
        if (settings.containsKey(VERSION)) {
           for (VersionInfo.VersionInformation mi : VersionInfo.getVersionInfo().values()) {
              System.out.println(mi);
           }
  
           return EXITFROMPROPERTYCODE;
        }
  
        if (settings.containsKey(HELP)) {
           showHelp(settings);
  
           return EXITFROMPROPERTYCODE;
        }
  
        if (STREAM.equals(settings.getProperty(STREAM, OUTPUT))) {
           OutputStream o = System.out;
  
           System.setOut(new PrintStream(settings.getProperty(getClass().getSimpleName() + ".out", SYSOUT),
               "UTF-8"));
           log.info("printing report to standard output");
  
           // stream
           return buildReport(null, o);
        } else {
           log.info(String.format("printing report to %s", settings.getProperty(OUTPUT)));
  
           String to = settings.getProperty(OUTPUT);
  
           if (to.indexOf(':') == -1) {
              to = "file:" + to;
           }
  
           URL u = new URL(to);
  
           if ("file".equals(u.getProtocol())) {
              // output file url not supported in java
              return buildReport(null, new FileOutputStream(u.getPath()));
           } else {
              URLConnection conn = u.openConnection();
  
              conn.setDoOutput(true);
              conn.setDoInput(false);
              return buildReport(null, conn.getOutputStream());
           }
  
        }
     }
docs: Calls {@link #buildReport(java.lang.String[], java.io.OutputStream) }, uses the setting {@link #OUTPUT}.
  
  @throws java.lang.Exception
  @param args the command line arguments
  @return the value returned by {@link ReportGenerator#generate(com.vectorprint.report.data.ReportDataHolder, java.io.OutputStream) },
  {@link #EXITFROMPROPERTYCODE}, {@link #EXITNOSETTINGS}