use of fr.xephi.authme.message.updater.MigraterYamlFileResource in project AuthMeReloaded by AuthMe.
the class MessagesFileWriter method performWrite.
private void performWrite() {
// Initialize ConfigMe classes
MessageKeyConfigurationData configurationData = MessageUpdater.createConfigurationData();
YamlFileResource resource = new MigraterYamlFileResource(file);
PropertyReader reader = resource.createReader();
configurationData.initializeValues(reader);
// Store initial comments so we can add them back later
List<String> initialComments = getInitialUserComments(configurationData);
// Create property resource with new defaults, save with ConfigMe for proper sections & comments
addMissingMessagesWithCommentMarker(reader, configurationData);
resource.exportProperties(configurationData);
// Go through the newly saved file and replace texts with comment marker to actual YAML comments
// and add initial comments back to the file
rewriteToFileWithComments(initialComments);
}
Aggregations