Force-saving router/swiftlet configuration from inside a Swiftlet
I am trying to make some changes to a proprietary extension swiftlet to allow some dynamic configuration changes on startup based on environmental conditions that the swiftlet is coded to check. Once I have made these changes to the Entity and EntityLists within my swiftlet's Configuration object, I want to save those changes to the RouterConfiguration file in the same way that can be done from the Explorer or the CLI.
Within the confines of the public SwiftMQ API, does anyone know the easiest way to do this from within an Extension Swiftlet? I can see writeContent methods within the Entity and Configuration objects, but no obvious way to construct the appropriate DataOutput relating to the running Router's configuration file; so I am assuming there is a better way, but haven't been able to find that better way.
Appreciate any help/ideas/sample or pseudo code.