Class ConfigWriter

java.lang.Object
com.djrapitops.plan.settings.config.ConfigWriter

public class ConfigWriter extends Object
Writer for parsing Config into file-lines.

ConfigReader can write a single file at a time, so it is NOT thread safe.

  • Constructor Details

    • ConfigWriter

      public ConfigWriter()
      Create a new ConfigWriter that doesn't write anywhere.
    • ConfigWriter

      public ConfigWriter(Path outputPath)
      Create a new ConfigWriter that writes to a Path.
      Parameters:
      outputPath - Path to write to.
  • Method Details

    • write

      public void write(ConfigNode writing) throws IOException
      Write a ConfigNode into the given resource.
      Parameters:
      writing - ConfigNode to write.
      Throws:
      IOException - If the Path given to constructor can not be written to.
      IllegalStateException - If the Path is null
    • createLines

      public List<String> createLines(ConfigNode writing)
      Parse the lines of a ConfigNode.

      "Write" the lines into a List.

      Parameters:
      writing - ConfigNode to "write"
      Returns:
      List of lines that would be written.