优化读取动态配置

This commit is contained in:
陈精华 2019-05-16 17:42:35 +08:00 committed by kl
parent 37fbc98827
commit f244054462
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,8 @@ public class ConfigRefreshComponent {
String officePreviewType;
String configFilePath = OfficeUtils.getCustomizedConfigPath();
while (true) {
BufferedReader bufferedReader = new BufferedReader(new FileReader(configFilePath));
FileReader fileReader = new FileReader(configFilePath);
BufferedReader bufferedReader = new BufferedReader(fileReader);
properties.load(bufferedReader);
text = properties.getProperty("simText", DEFAULT_TXT_TYPE);
media = properties.getProperty("media", DEFAULT_MEDIA_TYPE);
@ -58,6 +59,8 @@ public class ConfigRefreshComponent {
ConfigConstants.setMedia(mediaArray);
ConfigConstants.setConvertedFileCharset(convertedFileCharset);
ConfigConstants.setOfficePreviewType(officePreviewType);
bufferedReader.close();
fileReader.close();
Thread.sleep(1000L);
}
} catch (IOException | InterruptedException e) {