feat: make CMDConf to write pretty json into file

make CMDConf.write to write pretty json into cmconfig.json
This commit is contained in:
Frank.R.Wu 2021-12-09 14:38:28 +08:00
parent c8cf9cca58
commit c5fc2dc54e

View File

@ -3,6 +3,7 @@ package org.bdware.server;
import com.google.gson.Gson;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bdware.sc.util.JsonUtil;
import java.io.*;
import java.lang.reflect.Field;
@ -101,7 +102,7 @@ public class CMDConf {
try {
this.overwrite = false;
BufferedWriter bw = new BufferedWriter(new FileWriter(path));
bw.write(new Gson().toJson(this));
bw.write(JsonUtil.toPrettyJson(this));
bw.flush();
bw.close();
LOGGER.info("write new configure");