Commit f2440544 authored by 陈精华's avatar 陈精华 Committed by kl

优化读取动态配置

parent 37fbc988
...@@ -46,7 +46,8 @@ public class ConfigRefreshComponent { ...@@ -46,7 +46,8 @@ public class ConfigRefreshComponent {
String officePreviewType; String officePreviewType;
String configFilePath = OfficeUtils.getCustomizedConfigPath(); String configFilePath = OfficeUtils.getCustomizedConfigPath();
while (true) { while (true) {
BufferedReader bufferedReader = new BufferedReader(new FileReader(configFilePath)); FileReader fileReader = new FileReader(configFilePath);
BufferedReader bufferedReader = new BufferedReader(fileReader);
properties.load(bufferedReader); properties.load(bufferedReader);
text = properties.getProperty("simText", DEFAULT_TXT_TYPE); text = properties.getProperty("simText", DEFAULT_TXT_TYPE);
media = properties.getProperty("media", DEFAULT_MEDIA_TYPE); media = properties.getProperty("media", DEFAULT_MEDIA_TYPE);
...@@ -58,6 +59,8 @@ public class ConfigRefreshComponent { ...@@ -58,6 +59,8 @@ public class ConfigRefreshComponent {
ConfigConstants.setMedia(mediaArray); ConfigConstants.setMedia(mediaArray);
ConfigConstants.setConvertedFileCharset(convertedFileCharset); ConfigConstants.setConvertedFileCharset(convertedFileCharset);
ConfigConstants.setOfficePreviewType(officePreviewType); ConfigConstants.setOfficePreviewType(officePreviewType);
bufferedReader.close();
fileReader.close();
Thread.sleep(1000L); Thread.sleep(1000L);
} }
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment