Class LogHTMLFileHandler

java.lang.Object
outputProviders.logGenerator.LogHTMLFileHandler
Direct Known Subclasses:
AboutFuzzerPageGenerator, AllMapsPageGenerator, HomePageGenerator, OverviewAndConclusionsPageGenerator, WelcomePageGenerator

public class LogHTMLFileHandler extends Object
This class is responsible for the overall creation of the HTML page files that contains the report.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static List<String>
    A list with as string the headers of the CSV file.
    static final String
    Path to the HTML file that contains the generated about the fuzzer page of the report.
    static final String
    Path to the template for the HTML file that contains the template for the about the fuzzer page of the report.
    static final String
    Path to the HTML file that contains the generated all maps page of the report.
    static final String
    Path to the template for the HTML file that contains the template for the all maps page of the report.
    static final String
    Path to the HTML file that contains the generated home page of the report.
    static final String
    Path to the template for the HTML file that contains the template for the home page of the report.
    static final String
    Path to the HTML file that contains the generated overview report and conclusions page of the report.
    static final String
    Path to the template fo the HTML file that contains the template for the overview report and conclusions page of the report.
    static final String
    Path to the HTML file that contains the generated welcome page of the report.
    static final String
    Path to the template for the HTML file that containt the template for the welcome page of the report
    static List<List<String>>
    A list with items lists (row of the CSV file) of strings (values in the row of the CSV file).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Generates the HTML report by processing the log file, modifying the HTML templates of all pages, and writing the generated HTMLs to the appropriate HTML files.
    static int
    Gets the index of a specific column in the CSV data.
    static String
    getIDName (String header)
    Returns a string with the first letter of each word in the string capitalized, and the spaces between the words removed.
    static int
    Gets the index of a specific row in the CSV data.
    static List<String>
    getUniqueValues(int columnIndex)
    Returns the unique values of a specific column in the CSV data.
    void
    Constructor for the LogHTMLFileHandler class.
    void
    Processes the log file and extracts headers and rows of data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • headers

      public static List<String> headers
      A list with as string the headers of the CSV file. These are already formatted as wished.
    • rows

      public static List<List<String>> rows
      A list with items lists (row of the CSV file) of strings (values in the row of the CSV file).
    • ReportHomeTemplatePath

      public static final String ReportHomeTemplatePath
      Path to the template for the HTML file that contains the template for the home page of the report.
    • ReportAboutFuzzerTemplatePath

      public static final String ReportAboutFuzzerTemplatePath
      Path to the template for the HTML file that contains the template for the about the fuzzer page of the report.
    • ReportOverviewTemplatePath

      public static final String ReportOverviewTemplatePath
      Path to the template fo the HTML file that contains the template for the overview report and conclusions page of the report.
    • ReportAllMapsTemplatePath

      public static final String ReportAllMapsTemplatePath
      Path to the template for the HTML file that contains the template for the all maps page of the report.
    • ReportWelcomeTemplatePath

      public static final String ReportWelcomeTemplatePath
      Path to the template for the HTML file that containt the template for the welcome page of the report
    • ReportHomePath

      public static final String ReportHomePath
      Path to the HTML file that contains the generated home page of the report.
    • ReportAboutFuzzerPath

      public static final String ReportAboutFuzzerPath
      Path to the HTML file that contains the generated about the fuzzer page of the report.
    • ReportOverviewPath

      public static final String ReportOverviewPath
      Path to the HTML file that contains the generated overview report and conclusions page of the report.
    • ReportAllMapsPath

      public static final String ReportAllMapsPath
      Path to the HTML file that contains the generated all maps page of the report.
    • ReportWelcomePath

      public static final String ReportWelcomePath
      Path to the HTML file that contains the generated welcome page of the report.
  • Constructor Details

    • LogHTMLFileHandler

      public LogHTMLFileHandler()
  • Method Details

    • LogFileHTMLHandler

      public void LogFileHTMLHandler()
      Constructor for the LogHTMLFileHandler class. Do not initialize subclasses here!
    • generateHTMLReport

      public void generateHTMLReport()
      Generates the HTML report by processing the log file, modifying the HTML templates of all pages, and writing the generated HTMLs to the appropriate HTML files.
    • processLogFile

      public void processLogFile()
      Processes the log file and extracts headers and rows of data.
    • getUniqueValues

      public static List<String> getUniqueValues(int columnIndex)
      Returns the unique values of a specific column in the CSV data.
      Parameters:
      columnIndex - The index of the column.
      Returns:
      A list of unique values in the specified column.
    • getColumnIndex

      public static int getColumnIndex(String header)
      Gets the index of a specific column in the CSV data.
      Parameters:
      header - The header of the column.
      Returns:
      The index of the column in rows as int.
    • getRowIndex

      public static int getRowIndex (List<String> row)
      Gets the index of a specific row in the CSV data.
      Parameters:
      row - The row of the CSV data.
      Returns:
      The index of the row in rows as int.
    • getIDName

      public static String getIDName (String header)
      Returns a string with the first letter of each word in the string capitalized, and the spaces between the words removed. E.g. "this is a test" -> "ThisIsATest"
      Parameters:
      header - The string to be converted
      Returns:
      The converted string.