private static void exportCfg(ConfigInstance instance, String fileName) throws IOException {
        Writer writer = null;
        try {
            writer = IOUtils.createWriter(fileName, false);
            writer.write(instance.toString());
            writer.write("\n");
        } finally {
            if (writer != null) {
                IOUtils.closeWriter(writer);
            }
        }
    }
Exports a complete set of configuration-server format config files.

@param toDirectory  the directory to export to, current dir if null
@throws IOException if exporting fails, some files may still be created
config-model/src/main/java/com/yahoo/schema/derived/DerivedConfiguration.java