Class YmlLoader
java.lang.Object
com.github.cyberryan1.cybercore.spigot.config.YmlLoader
Loads YML files via the following:
- Creates the file if it doesn't exist
- If the file already exists, updates it's contents
FileConfiguration
object.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new YMLManager of the specifiedFileType
Creates a new YMLManager with the specified file name.Creates a new YMLManager with the specified main file and default file locations. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.configuration.file.FileConfiguration
Gets theFileConfiguration
of this filevoid
Creates and updates the config files, as needed Also initializes the FileConfigurationvoid
Reloads the configuration from the filevoid
Saves the configuration to the file
-
Constructor Details
-
YmlLoader
Creates a new YMLManager of the specifiedFileType
- Parameters:
type
- FileType of the file this represents
-
YmlLoader
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
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 theFileType
of this YMLManager will beFileType.CUSTOM
.- Parameters:
mainFileLocation
- Location of the main filedefaultFileLocation
- 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 theFileConfiguration
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
- Returns:
- The
FileType
used
-