Class SettingsManager
java.lang.Object
net.vincent.communidirect.common.config.SettingsManager
Loads and persists CommuniDirect settings from
~/.communidirect/config.toml.
If the file (or its parent directory) does not exist it is created with built-in
defaults. The log directory is also created if it is absent.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFilename (not path) for the access log (default "access.log").Filename (not path) for the error log (default "err.log").getIp()Bind IP address (default "127.0.0.1").Absolute path to the log directory, with~expanded to the home directory.intgetPort()Listening port (default 9833).voidload()Loads configuration from disk.static StringresolveHome(String path) Expands a leading~to the current user's home directory.
-
Constructor Details
-
SettingsManager
public SettingsManager()Initialises all fields with their compiled-in defaults. Callload()to overlay values from~/.communidirect/config.toml.
-
-
Method Details
-
load
public void load()Loads configuration from disk. Creates the config file (and all required directories) with default values if it does not already exist. -
resolveHome
-
getPort
public int getPort()Listening port (default 9833). -
getIp
Bind IP address (default "127.0.0.1"). -
getLogDir
Absolute path to the log directory, with~expanded to the home directory. -
getAccessLogName
Filename (not path) for the access log (default "access.log"). -
getErrLogName
-