Interface YAMLManager


public interface YAMLManager
  • Method Details

    • getConfig

      YAMLConfig getConfig(File file, String id)
      Get a YAMLConfig from a file.
      Parameters:
      file - File to get the YAML from.
      id - Identifier of the file.
      Returns:
      YAMLConfig of the given File.
    • getConfigSection

      YAMLSection getConfigSection(org.bukkit.configuration.ConfigurationSection section)
      Load a Bukkit configuration section as Additions YAMLSection. The YAMLSection that is returned using this method cannot be used to save the file using YAMLSection.save(). If you wish to save the file too, please use getConfigSection(File, FileConfiguration, ConfigurationSection).
      Parameters:
      section - Bukkit section to load.
      Returns:
      YAMLSection when successful, null otherwise.
    • getConfigSection

      YAMLSection getConfigSection(File file, org.bukkit.configuration.file.FileConfiguration baseYAML, org.bukkit.configuration.ConfigurationSection section)
      Load a Bukkit configuration section as Additions YAMLSection.
      Parameters:
      file - File to load from.
      baseYAML - Bukkit base file configuration of the section.
      section - Bukkit section to load.
      Returns:
      YAMLSection when successful, null otherwise.
    • loadConfig

      YAMLConfig loadConfig(String id, File directory, String fileName)
      Load config or create it if nonexistent
      Parameters:
      id - The internal ID of the config
      directory - The sub-directory in which to place the config file when created
      fileName - The name of the file placed in the previously mentioned directory
      Returns:
      A YAMLConfig instance based on the arguments provided
    • loadConfig

      YAMLConfig loadConfig(String id, String directory, String fileName)
      Load config or create it if nonexistent
      Parameters:
      id - The internal ID of the config
      directory - The subdirectory in which to place the config file when created
      fileName - The name of the file placed in the previously mentioned directory
      Returns:
      A YAMLConfig instance based on the arguments provided
    • loadConfig

      YAMLConfig loadConfig(String id, File directory, String fileName, String defaultDir)
      Load config or create it if nonexistent
      Parameters:
      id - The internal ID of the config
      directory - The subdirectory in which to place the config file when created
      fileName - The name of the file placed in the previously mentioned directory
      defaultDir - The internal directory from which to fetch the default file
      Returns:
      A YAMLConfig instance based on the arguments provided
    • loadConfig

      YAMLConfig loadConfig(String id, String directory, String fileName, String defaultDir)
      Load config or create it if nonexistent
      Parameters:
      id - The internal ID of the config
      directory - The sub-directory in which to place the config file when created
      fileName - The name of the file placed in the previously mentioned directory
      defaultDir - The internal directory from which to fetch the default file
      Returns:
      A YAMLConfig instance based on the arguments provided
    • getConfig

      YAMLConfig getConfig(String configId)
      Get a previously initialized config file by config ID
      Parameters:
      configId - The internal config ID of the config
      Returns:
      The YAMLConfig instance with the ID provided or null if no YAMLConfig exists with that ID
    • copyDefaultFile

      boolean copyDefaultFile(File file, String fileName, String defaultFilePath)
      Copy the default file contents into the new file.
      Parameters:
      file - File to copy contents to.
      fileName - The name of the file to use as the default file.
      defaultFilePath - Location of the default file.
      Returns:
      True when succeeded, false otherwise.
    • getDefaultFileReader

      BufferedReader getDefaultFileReader(String fileName, String defaultFilePath)
      Get the FileConfiguration for the file name specified
      Parameters:
      fileName - The name of the file to use as the default file
      defaultFilePath - Location of the default file
      Returns:
      BufferedReader with the default file contents.