Class ConfigUpdater

java.lang.Object
com.tchristofferson.configupdater.ConfigUpdater

public class ConfigUpdater extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    update(org.bukkit.plugin.Plugin plugin, String resourceName, File toUpdate, String... ignoredSections)
    Update the YAML file inside the plugin folder, only if it does not match the file from the JAR.
    static void
    update(org.bukkit.plugin.Plugin plugin, String resourceName, File toUpdate, List<String> ignoredSections)
    Update the YAML file inside the plugin folder, only if it does not match the file from the JAR.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfigUpdater

      public ConfigUpdater()
  • Method Details

    • update

      public static void update(org.bukkit.plugin.Plugin plugin, String resourceName, File toUpdate, String... ignoredSections) throws IOException
      Update the YAML file inside the plugin folder, only if it does not match the file from the JAR.
      Parameters:
      plugin - the main class instance where you extend JavaPlugin.
      resourceName - the path to your original YAML file inside the JAR.
      toUpdate - the file you want to update.
      ignoredSections - the array of ignored section values, where each element represents the full path or the first path of the ignored section and the value is the YAML content to keep unchanged.
      Throws:
      IOException - if an I/O error occurs when writing to BufferedWriter or if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
    • update

      public static void update(org.bukkit.plugin.Plugin plugin, String resourceName, File toUpdate, List<String> ignoredSections) throws IOException
      Update the YAML file inside the plugin folder, only if it does not match the file from the JAR.
      Parameters:
      plugin - the main class instance where you extend JavaPlugin.
      resourceName - the path to your original YAML file inside the JAR.
      toUpdate - the file you want to update.
      ignoredSections - the list of ignored section values, where each element represents the full path or the first path of the ignored section and the value is the YAML content to keep unchanged.
      Throws:
      IOException - if an I/O error occurs when writing to BufferedWriter or if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.