From c5fc2dc54e8b58cc201d278d0f2f72c9ed1e7b2d Mon Sep 17 00:00:00 2001 From: "Frank.R.Wu" Date: Thu, 9 Dec 2021 14:38:28 +0800 Subject: [PATCH] feat: make CMDConf to write pretty json into file make CMDConf.write to write pretty json into cmconfig.json --- src/main/src/org/bdware/server/CMDConf.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/src/org/bdware/server/CMDConf.java b/src/main/src/org/bdware/server/CMDConf.java index bd896c0..4ba8d7e 100644 --- a/src/main/src/org/bdware/server/CMDConf.java +++ b/src/main/src/org/bdware/server/CMDConf.java @@ -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");