Class ConfigManager
java.lang.Object
ConfigManager
Class for managing configuration data stored in a properties file.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConfigManager
(String configPath) Constructs a new Config object by reading configuration data from the specified file path. -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDate
formatToLocalDate
(String timestamp) Formats the provided timestamp string to a LocalDate object.static void
saveTimestamp
(String timestamp, String configPath) Saves the provided timestamp to the configuration file.
-
Field Details
-
timeframe
public final int timeframeThe 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
The login read from the configuration file. -
password
The password read from the configuration file. -
arg
Argument for the webdriver. Can be "--headless", anything else is ignored. -
timestamp
The timestamp read from the configuration file. Either empty or date of the saved timetable.
-
-
Constructor Details
-
ConfigManager
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
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
Formats the provided timestamp string to a LocalDate object.- Parameters:
timestamp
- The timestamp string to be formatted.- Returns:
- The formatted LocalDate object.
-