Interface FileFacade


public interface FileFacade
The single entry point to the loaded config files. Everything reads settings through here so a reload can swap the whole set at once.
  • Method Details

    • reload

      void reload() throws IOException
      Re-reads every file from disk and replaces the loaded set.
      Throws:
      IOException - if a file cannot be read
    • command

      Command command()
      The loaded command.yml.
      Returns:
      the command settings
    • config

      Config config()
      The loaded config.yml.
      Returns:
      the general settings
    • integration

      Integration integration()
      The loaded integration.yml.
      Returns:
      the integration settings
    • message

      Message message()
      The loaded message.yml.
      Returns:
      the message settings
    • permission

      Permission permission()
      The loaded permission.yml.
      Returns:
      the permission settings
    • localizations

      Map<String, Localization> localizations()
      Every loaded localization, keyed by locale name.
      Returns:
      the localizations
    • localization

      Localization localization()
      The localization for the server default language.
      Returns:
      the default localization
    • localization

      Localization localization(@Nullable String locale)
      The localization for a locale, falling back to the server default when it is unknown.
      Parameters:
      locale - the locale name, may be null
      Returns:
      the matching localization, or the default one
    • saveFiles

      void saveFiles()
      Writes the loaded files back to disk.
    • updateFiles

      void updateFiles()
      Runs the pending migrations and writes the results to disk.
    • updateFilePack

      void updateFilePack(UnaryOperator<FilePack> filePackOperator)
      Replaces the loaded set with a modified copy, used to correct a setting at runtime.
      Parameters:
      filePackOperator - produces the new set from the current one
    • getPreInitVersion

      String getPreInitVersion()
      The plugin version the config files were written by, read before any migration ran.
      Returns:
      the previous version, or null if the files are new