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 Summary
Modifier and TypeMethodDescriptioncommand()The loaded command.yml.config()The loaded config.yml.The plugin version the config files were written by, read before any migration ran.The loaded integration.yml.The localization for the server default language.localization(@Nullable String locale) The localization for a locale, falling back to the server default when it is unknown.Every loaded localization, keyed by locale name.message()The loaded message.yml.The loaded permission.yml.voidreload()Re-reads every file from disk and replaces the loaded set.voidWrites the loaded files back to disk.voidupdateFilePack(UnaryOperator<FilePack> filePackOperator) Replaces the loaded set with a modified copy, used to correct a setting at runtime.voidRuns the pending migrations and writes the results to disk.
-
Method Details
-
reload
Re-reads every file from disk and replaces the loaded set.- Throws:
IOException- if a file cannot be read
-
command
-
config
-
integration
-
message
-
permission
-
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
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
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
-