Class ConfigurationManager
- java.lang.Object
-
- net.i2p.i2pcontrol.servlets.configuration.ConfigurationManager
-
public class ConfigurationManager extends Object
Manage the configuration of I2PControl.- Author:
- mathias modified: hottuna
-
-
Constructor Summary
Constructors Constructor Description ConfigurationManager(I2PAppContext ctx, File dir, boolean isPlugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 settingvoid
setConf(String settingName, int nbr)
Set a specific int settingvoid
setConf(String settingName, String str)
Set a specific string settingvoid
writeConfFile()
Write configuration into default config file.
-
-
-
Constructor Detail
-
ConfigurationManager
public ConfigurationManager(I2PAppContext ctx, File dir, boolean isPlugin)
-
-
Method Detail
-
getConfFile
public File getConfFile()
- Since:
- 0.12
-
readConfFile
public void readConfFile()
Reads configuration from file, every line is parsed as key=value.
-
writeConfFile
public void writeConfFile()
Write configuration into default config file. As of 0.12, doesn't actually write unless something changed.
-
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.
-
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
-
-
setConf
public void setConf(String settingName, boolean bool)
Set a specific boolean setting- Parameters:
settingName
-bool
-
-
-