Class Configuration

java.lang.Object
zleurtor.scanmanager.model.Configuration

public final class Configuration extends Object
The class having in charge to read and store the configuration.
Author:
Zleurtor
  • Method Details

    • getInstance

      public static Configuration getInstance()
      Returns the singleton instance of the configuration.
      Returns:
      The singleton instance of the configuration.
    • getString

      public String getString(String key)
      Searches for the property with the specified key in this property list.
      Parameters:
      key - The property key.
      Returns:
      The value in this property list with the specified key value.
    • getInt

      public int getInt(String key)
      Searches for the property with the specified key in this property list.
      Parameters:
      key - The property key.
      Returns:
      The value (as an integer) in this property list with the specified key value.
    • setString

      public void setString(String key, String value)
      Set the specified value to the specified key.
      Parameters:
      key - The key for which the value shall be set.
      value - The value to set to the key.
    • updateVersion

      public void updateVersion(String newVersion) throws IOException
      Update the version in the main configuration file.
      Parameters:
      newVersion - The new version to set in the configuration file.
      Throws:
      IOException - if an error occurred when reading/writing the configuration file.