java.lang.Object
com.github.cyberryan1.cybercore.spigot.config.YmlLoader

public class YmlLoader extends Object
Loads YML files via the following:
  • Creates the file if it doesn't exist
  • If the file already exists, updates it's contents
When the above is completed, the file is loaded into a FileConfiguration object.
  • Constructor Details

    • YmlLoader

      public YmlLoader(FileType type)
      Creates a new YMLManager of the specified FileType
      Parameters:
      type - FileType of the file this represents
    • YmlLoader

      public YmlLoader(String fileName)
      Creates a new YMLManager with the specified file name. File name should not include the directory To the plugin.
      Parameters:
      fileName - Name of the file this represents
    • YmlLoader

      public YmlLoader(String mainFileLocation, String defaultFileLocation)
      Creates a new YMLManager with the specified main file and default file locations. To include directories, separate them with a forward slash (forward slash = /). Note that the FileType of this YMLManager will be FileType.CUSTOM.
      Parameters:
      mainFileLocation - Location of the main file
      defaultFileLocation - Location of the default file
  • Method Details

    • initialize

      public void initialize()
      Creates and updates the config files, as needed Also initializes the FileConfiguration
    • getConfig

      public org.bukkit.configuration.file.FileConfiguration getConfig()
      Gets the FileConfiguration of this file
      Returns:
      Configuration of this file
    • saveConfig

      public void saveConfig()
      Saves the configuration to the file
    • reloadConfiguration

      public void reloadConfiguration()
      Reloads the configuration from the file
    • getFileType

      public FileType getFileType()
      Returns:
      The FileType used