Class ConfigService
java.lang.Object
com.zetaplugins.zetacore.services.config.ConfigService
Service for managing plugin configuration files with caching support.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the configuration cache.getConfig(PluginConfig config) Get a configuration file based on the provided PluginConfig enum.getConfig(PluginConfig config, boolean useCache) Get a configuration file based on the provided PluginConfig enum.Get a configuration file based on the provided file name.Get a configuration file based on the provided file name.
-
Constructor Details
-
ConfigService
Construct a new ConfigService.- Parameters:
plugin- The JavaPlugin instance.
-
-
Method Details
-
getConfig
Get a configuration file based on the provided PluginConfig enum.- Parameters:
config- The PluginConfig enum representing the desired configuration file.- Returns:
- The FileConfiguration object for the specified configuration file.
-
getConfig
Get a configuration file based on the provided PluginConfig enum.- Parameters:
config- The PluginConfig enum representing the desired configuration file.useCache- Whether to use the cached version if available.- Returns:
- The FileConfiguration object for the specified configuration file.
-
getConfig
Get a configuration file based on the provided file name.- Parameters:
fileName- The name of the configuration file (without the .yml extension).- Returns:
- The FileConfiguration object for the specified configuration file.
-
getConfig
Get a configuration file based on the provided file name.- Parameters:
fileName- The name of the configuration file (without the .yml extension).useCache- Whether to use the cached version if available.- Returns:
- The FileConfiguration object for the specified configuration file.
-
clearCache
public void clearCache()Clear the configuration cache.
-