Class ConfigManager

java.lang.Object
ConfigManager

public class ConfigManager extends Object
Class for managing configuration data stored in a properties file.
  • Field Details

    • timeframe

      public final int timeframe
      The timeframe value. Determines the amount of days that the timetable can be away from. Use with caution. High values can cause very long scraping time.
    • login

      public final String login
      The login read from the configuration file.
    • password

      public final String password
      The password read from the configuration file.
    • arg

      public final String arg
      Argument for the webdriver. Can be "--headless", anything else is ignored.
    • timestamp

      public final String timestamp
      The timestamp read from the configuration file. Either empty or date of the saved timetable.
  • Constructor Details

    • ConfigManager

      public ConfigManager(String configPath) throws IOException
      Constructs a new Config object by reading configuration data from the specified file path.
      Parameters:
      configPath - The path to the configuration file.
      Throws:
      IOException - If an I/O error occurs while reading the configuration file.
  • Method Details

    • saveTimestamp

      public static void saveTimestamp(String timestamp, String configPath) throws IOException
      Saves the provided timestamp to the configuration file.
      Parameters:
      timestamp - The timestamp to be saved.
      configPath - The path to the configuration file.
      Throws:
      IOException - If an I/O error occurs while writing to the configuration file.
    • formatToLocalDate

      public static LocalDate formatToLocalDate(String timestamp)
      Formats the provided timestamp string to a LocalDate object.
      Parameters:
      timestamp - The timestamp string to be formatted.
      Returns:
      The formatted LocalDate object.