mirror of
https://gitee.com/BDWare/front-base
synced 2025-01-10 09:54:00 +00:00
feat: make CMDConf to write pretty json into file
make CMDConf.write to write pretty json into cmconfig.json
This commit is contained in:
parent
c8cf9cca58
commit
c5fc2dc54e
@ -3,6 +3,7 @@ package org.bdware.server;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bdware.sc.util.JsonUtil;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@ -101,7 +102,7 @@ public class CMDConf {
|
|||||||
try {
|
try {
|
||||||
this.overwrite = false;
|
this.overwrite = false;
|
||||||
BufferedWriter bw = new BufferedWriter(new FileWriter(path));
|
BufferedWriter bw = new BufferedWriter(new FileWriter(path));
|
||||||
bw.write(new Gson().toJson(this));
|
bw.write(JsonUtil.toPrettyJson(this));
|
||||||
bw.flush();
|
bw.flush();
|
||||||
bw.close();
|
bw.close();
|
||||||
LOGGER.info("write new configure");
|
LOGGER.info("write new configure");
|
||||||
|
Loading…
Reference in New Issue
Block a user