Package wtf.choco.veinminer.util
Class ConfigWrapper
java.lang.Object
wtf.choco.veinminer.util.ConfigWrapper
A simple wrapper to more easily handle
YamlConfiguration
instances.-
Constructor Summary
ConstructorDescriptionConfigWrapper
(@NotNull JavaPlugin plugin, @NotNull File directory, @NotNull String name) Construct a newConfigWrapper
.ConfigWrapper
(@NotNull JavaPlugin plugin, @NotNull String path) Construct a newConfigWrapper
. -
Method Summary
Modifier and TypeMethodDescription@NotNull FileConfiguration
Get thisConfigWrapper
as a rawFileConfiguration
instance.void
reload()
Reload values from file into memory.void
save()
Save thisConfigWrapper
.void
Save thisConfigWrapper
and throw anIOException
if one occurs according toFileConfiguration.save(File)
.
-
Constructor Details
-
ConfigWrapper
public ConfigWrapper(@NotNull @NotNull JavaPlugin plugin, @NotNull @NotNull File directory, @NotNull @NotNull String name) Construct a newConfigWrapper
.- Parameters:
plugin
- the plugin instancedirectory
- the directory at which the config is locatedname
- the name of the config file
-
ConfigWrapper
Construct a newConfigWrapper
.- Parameters:
plugin
- the plugin instancepath
- the path at which the config is located
-
-
Method Details
-
asRawConfig
Get thisConfigWrapper
as a rawFileConfiguration
instance.- Returns:
- the raw config
-
saveExceptionally
Save thisConfigWrapper
and throw anIOException
if one occurs according toFileConfiguration.save(File)
.- Throws:
IOException
- if an IOException is thrown byFileConfiguration.save(File)
-
save
public void save()Save thisConfigWrapper
. -
reload
public void reload()Reload values from file into memory.
-