[Change] 调整数据存储的路径设置及存储目录参数名;

This commit is contained in:
2020-04-30 17:51:57 +08:00
parent e8fda3214b
commit a28cb142b4
4 changed files with 16 additions and 16 deletions

View File

@ -22,9 +22,9 @@ public class BotAdminCommandProcess {
private final static Logger log = LoggerFactory.getLogger(BotAdminCommandProcess.class.getSimpleName());
private final static File globalPropFile = new File("global.properties");
private final static File globalPropFile = new File(System.getProperty("cgj.botDataDir"), "global.properties");
private final static File pushListFile = new File("pushList.json");
private final static File pushListFile = new File(System.getProperty("cgj.botDataDir"), "pushList.json");
private final static Hashtable<Long, JsonObject> pushInfoMap = new Hashtable<>();

View File

@ -41,7 +41,7 @@ public class BotCommandProcess {
private final static Logger log = LoggerFactory.getLogger(BotCommandProcess.class.getSimpleName());
private final static File imageStoreDir = new File(System.getProperty("cgj.cqRootDir"), "data/image/cgj/");
private final static File imageStoreDir = new File(System.getProperty("cgj.botDataDir"), "data/image/cgj/");
public final static Properties globalProp = new Properties();
private final static Gson gson = new GsonBuilder()
.serializeNulls()
@ -76,7 +76,7 @@ public class BotCommandProcess {
public static void initialize() {
log.info("正在初始化...");
File globalPropFile = new File("./global.properties");
File globalPropFile = new File(System.getProperty("cgj.botDataDir"), "global.properties");
if(globalPropFile.exists() && globalPropFile.isFile()) {
log.info("正在加载全局配置文件...");
try {
@ -590,7 +590,7 @@ public class BotCommandProcess {
illustPreLoadDataCache.clear();
pagesCache.clear();
searchBodyCache.clear();
File imageStoreDir = new File(System.getProperty("cgj.cqRootDir") + "data/image/cgj/");
File imageStoreDir = new File(System.getProperty("cgj.botDataDir") + "data/image/cgj/");
File[] listFiles = imageStoreDir.listFiles();
if (listFiles == null) {
log.debug("图片缓存目录为空或内部文件获取失败!");

View File

@ -34,7 +34,7 @@ public class MiraiMain implements Closeable {
return;
}
File botPropFile = new File("./bot.properties");
File botPropFile = new File(System.getProperty("cgj.botDataDir"), "./bot.properties");
try (Reader reader = new BufferedReader(new FileReader(botPropFile))) {
botProperties.load(reader);
} catch (IOException e) {