Class BukkitScriptConfig

All Implemented Interfaces:
dev.magicmq.pyspigot.manager.config.ScriptConfig, Configuration, ConfigurationSection

public class BukkitScriptConfig extends YamlConfiguration implements dev.magicmq.pyspigot.manager.config.ScriptConfig
A class representing a script configuration file, for the Bukkit implementation.
See Also:
  • Constructor Details

    • BukkitScriptConfig

      public BukkitScriptConfig(File configFile, String defaults)
      Parameters:
      configFile - The configuration file
      defaults - A YAML-formatted string containing the desired default values for the configuration
  • Method Details

    • getConfigFile

      public File getConfigFile()
      Specified by:
      getConfigFile in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
    • getConfigPath

      public Path getConfigPath()
      Specified by:
      getConfigPath in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
    • load

      public void load() throws IOException
      Specified by:
      load in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
      Throws:
      IOException
    • reload

      public void reload() throws IOException
      Specified by:
      reload in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
      Throws:
      IOException
    • save

      public void save() throws IOException
      Specified by:
      save in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
      Throws:
      IOException
    • setIfNotExists

      public boolean setIfNotExists(String path, Object value)
      Sets the specified path to the given value only if the path is not already set in the config file. Any specified default values are ignored when checking if the path is set.
      Specified by:
      setIfNotExists in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
      Parameters:
      path - Path of the object to set
      value - Value to set the path to
      Returns:
      True if the path was set to the value (in other words the path was not previously set), false if the path was not set to the value (in other words the path was already previously set)
      See Also: