public void run()

in src/main/java/com/googlesource/gerrit/plugins/auditsl4j/TransformLogsCommand.java [61:92]


  public void run() {

    Date dateFrom;
    try {
      dateFrom = format.parse(from);
    } catch (Exception e) {
      stderr.print("Invalid 'from' format: " + from + ", expected format <YYYY-MM-DD>");
      return;
    }
    Date dateUntil;
    try {
      dateUntil = format.parse(until);
    } catch (Exception e) {
      stderr.print("Invalid 'until' format: " + until + ", expected format <YYYY-MM-DD>");
      return;
    }

    if (dateFrom.after(dateUntil)) {
      stderr.print("'from' cannot be after 'until'");
      return;
    }

    Date currentDate = dateFrom;
    while (currentDate.compareTo(dateUntil) <= 0) {
      transformHttpdLogs(format.format(currentDate));
      transformSshdLogs(format.format(currentDate));

      currentDate = getTomorrowDate(currentDate);
    }

    stdout.print("Transformed HTTP and SSH logs from " + from + " until " + until + "!\n");
  }