Class ConfigEditorUtils

java.lang.Object
com.ultikits.ultitools.utils.ConfigEditorUtils

public class ConfigEditorUtils extends Object
Utility class for configuration editor operations. Provides methods to get and update configuration data in JSON format. This class is used internally by the configuration editor system.
Since:
6.0.0
Author:
wisdomme
  • Constructor Details

    • ConfigEditorUtils

      public ConfigEditorUtils()
  • Method Details

    • getConfigMapString

      protected static String getConfigMapString()
      Get the configuration map as a JSON string.
      Returns:
      JSON string representation of the configuration map
    • getCommentMapString

      protected static String getCommentMapString()
      Get the comment map as a JSON string.
      Returns:
      JSON string representation of the comment map
    • updateConfigMap

      protected static void updateConfigMap(String configMapString) throws IOException
      Update the configuration map from a JSON string.
      Parameters:
      configMapString - JSON string containing the new configuration
      Throws:
      IOException - if an I/O error occurs during update
    • updateConfigMap

      protected static void updateConfigMap(String fileName, String configMapString) throws IOException
      Update a single configuration file from a JSON string.

      This is the path taken when the panel pushes configuration by file name: configMapString is that file's own {configEntry: value}, not the full {pluginName: {configPath: {...}}} structure that updateConfigMap(String) expects. The two shapes correspond to two distinct entry points on the panel; mixing them silently fails to write and reports no error -- see issue #236.

      Parameters:
      fileName - config file path as registered, e.g. config/lang.yml
      configMapString - JSON string containing that file's entries
      Throws:
      IOException - if the file is unknown or ambiguous, or the update fails
      Since:
      6.2.5