public interface ConfigRoot
The underlying directory may refer to a shared directory (shared
by many plugins) or one that is specific to a plugin. Be mindful
of simply storing data in getDirectory()
depending on the
type of configuration root.
A default configuration file is provided via both
getConfigPath()
and getConfig()
, but other or additional
configuration files can be stored in the directory returned by
getDirectory()
(as long as it's
not the shared configuration folder).
A provider of configuration root
Modifier and Type | Method and Description |
---|---|
ConfigurationLoader<CommentedConfigurationNode> |
getConfig()
Gets the configuration file that utilizes the default configuration
pathname.
|
Path |
getConfigPath()
Gets the pathname to the default configuration file for the plugin.
|
Path |
getDirectory()
Gets the directory that this configuration root refers to.
|
Path getConfigPath()
If the configuration root is shared, then the returned pathname will
refer to the path $config/$plugin_id.conf
(where "$config" is the
shared configuration directory). Otherwise, the returned pathname will
refer to a file named "config.conf" stored in a directory specific to
the plugin.
The returned pathname may refer to a file that does not yet exist. It is up to the caller of this method to create the file if desired.
DefaultConfig
ConfigurationLoader<CommentedConfigurationNode> getConfig()
getConfigPath()
Path getDirectory()
The returned pathname may not refer to a directory that exists yet.