Package org.leralix.lib.utils.config
Class ConfigUtil
java.lang.Object
org.leralix.lib.utils.config.ConfigUtil
This class is used for config related utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCustomConfig(File file, ConfigTag tag) Load a custom config file into the memorystatic voidaddCustomConfig(org.bukkit.plugin.Plugin plugin, String fileName, ConfigTag tag) static org.bukkit.configuration.file.FileConfigurationgetCustomConfig(ConfigTag tag) Get a custom config by its name.static voidsaveAndUpdateResource(org.bukkit.plugin.Plugin plugin, String fileName) static voidsaveAndUpdateResource(org.bukkit.plugin.Plugin plugin, String fileName, Collection<String> sectionBlacklist) Save and update a resource file.
-
Method Details
-
getCustomConfig
Get a custom config by its name.- Parameters:
tag- The tag of the config file.- Returns:
- The
FileConfigurationobject.
-
addCustomConfig
-
addCustomConfig
Load a custom config file into the memory- Parameters:
file- The file to loadtag- The tag to associate with
-
saveAndUpdateResource
-
saveAndUpdateResource
public static void saveAndUpdateResource(org.bukkit.plugin.Plugin plugin, String fileName, Collection<String> sectionBlacklist) Save and update a resource file. If some lines are missing in the current file, they will be added at the correct position.- Parameters:
fileName- The name of the resource file.
-