Klasse FileConfig


class FileConfig extends AbstractConfig
Manages the bootstrap configuration. It MUST contain all config values that are needed to establish a database connection. For further configuration values use the Config class instead as that class stores its values within the database.
Seit:
sonews/0.5.0
Autor:
Christian Lins
  • Felddetails

    • defaultConfig

      private static final Properties defaultConfig
    • instance

      private static FileConfig instance
    • settings

      private final Properties settings
    • log

      private final org.slf4j.Logger log
  • Konstruktordetails

    • FileConfig

      private FileConfig()
      Config is a singelton class with only one instance at time. So the constructor is private to prevent the creation of more then one Config instance.
  • Methodendetails

    • getInstance

      public static FileConfig getInstance()
    • load

      public final void load() throws IOException
      Loads the configuration from the config file. By default this is done by the (private) constructor but it can be useful to reload the config by invoking this method.
      Löst aus:
      IOException
    • save

      public void save() throws FileNotFoundException, IOException
      Saves this Config to the config file. By default this is done at program end.
      Löst aus:
      FileNotFoundException
      IOException
    • get

      public String get(String key, String def)
      Returns the value that is stored within this config identified by the given key. If the key cannot be found the default value is returned.
      Angegeben von:
      get in Klasse AbstractConfig
      Parameter:
      key - Key to identify the value.
      def - The default value that is returned if the key is not found in this Config.
      Gibt zurück:
    • set

      public void set(String key, String value)
      Sets the value for a given key.
      Angegeben von:
      set in Klasse AbstractConfig
      Parameter:
      key -
      value -