net.i2p.i2pcontrol.servlets.configuration

## Class ConfigurationManager

- java.lang.Object
- - net.i2p.i2pcontrol.servlets.configuration.ConfigurationManager

-     public class ConfigurationManager
      extends Object

  Manage the configuration of I2PControl.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigurationManager(I2PAppContext ctx, File dir, boolean isPlugin)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `getConf(String settingName, boolean defaultValue)` Check if a specific boolean configuration exists.
    `int` | `getConf(String settingName, int defaultValue)` Check if a specific boolean configuration exists.
    `String` | `getConf(String settingName, String defaultValue)` Get a specific String configuration.
    `File` | `getConfFile()`
    `void` | `readConfFile()` Reads configuration from file, every line is parsed as key=value.
    `void` | `setConf(String settingName, boolean bool)` Set a specific boolean setting
    `void` | `setConf(String settingName, int nbr)` Set a specific int setting
    `void` | `setConf(String settingName, String str)` Set a specific string setting
    `void` | `writeConfFile()` Write configuration into default config file.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConfigurationManager

          public ConfigurationManager(I2PAppContext ctx,
                                      File dir,
                                      boolean isPlugin)

  - ### Method Detail

    - #### getConf

          public boolean getConf(String settingName,
                                 boolean defaultValue)

      Check if a specific boolean configuration exists.
      Parameters:
        `settingName` - The key for the configuration.
        `defaultValue` - If the configuration is not found, we use a default value.
      Returns:
        The value of a configuration: true if found, defaultValue if not found.

    - #### getConf

          public int getConf(String settingName,
                             int defaultValue)

      Check if a specific boolean configuration exists.
      Parameters:
        `settingName` - The key for the configuration.
        `defaultValue` - If the configuration is not found, we use a default value.
      Returns:
        The value of a configuration: true if found, defaultValue if not found.

    - #### getConf

          public String getConf(String settingName,
                                String defaultValue)

      Get a specific String configuration.
      Parameters:
        `settingName` - The key for the configuration.
        `defaultValue` - If the configuration is not found, we use a default value.
      Returns:
        The value of the configuration, or the defaultValue.

    - #### getConfFile

          public File getConfFile()

    - #### readConfFile

          public void readConfFile()

      Reads configuration from file, every line is parsed as key=value.

    - #### setConf

          public void setConf(String settingName,
                              boolean bool)

      Set a specific boolean setting
      Parameters:
        `settingName` -
        `bool` -

    - #### setConf

          public void setConf(String settingName,
                              int nbr)

      Set a specific int setting
      Parameters:
        `settingName` -
        `nbr` -

    - #### setConf

          public void setConf(String settingName,
                              String str)

      Set a specific string setting
      Parameters:
        `settingName` -
        `str` -

    - #### writeConfFile

          public void writeConfFile()

      Write configuration into default config file. As of 0.12, doesn't actually write unless something changed.