You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2022/10/27 08:06:07 UTC
[incubator-eventmesh] branch master updated: style(ConfigurationWrapper.java): replace repeat method
This is an automated email from the ASF dual-hosted git repository.
mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 239c76f1 style(ConfigurationWrapper.java): replace repeat method
new 6bd10f88 Merge pull request #1953 from dinghuang/master
239c76f1 is described below
commit 239c76f1a1d5945b9de203a4af3b7dc0d11f9c6f
Author: edisionding <ed...@webank.com>
AuthorDate: Thu Oct 27 11:30:01 2022 +0800
style(ConfigurationWrapper.java): replace repeat method
#1889
---
.../eventmesh/connector/rocketmq/config/ConfigurationWrapper.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/config/ConfigurationWrapper.java b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/config/ConfigurationWrapper.java
index 83036bb3..af5faceb 100644
--- a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/config/ConfigurationWrapper.java
+++ b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/config/ConfigurationWrapper.java
@@ -18,13 +18,12 @@
package org.apache.eventmesh.connector.rocketmq.config;
import org.apache.eventmesh.common.Constants;
+import org.apache.eventmesh.common.utils.PropertiesUtils;
import org.apache.eventmesh.connector.rocketmq.common.EventMeshConstants;
import org.apache.commons.lang3.StringUtils;
-import java.io.BufferedReader;
import java.io.File;
-import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
@@ -61,9 +60,7 @@ public class ConfigurationWrapper {
}
try {
String configPath = Constants.EVENTMESH_CONF_HOME + File.separator + EventMeshConstants.EVENTMESH_CONF_FILE;
- if (new File(configPath).exists()) {
- properties.load(new BufferedReader(new FileReader(configPath)));
- }
+ PropertiesUtils.loadPropertiesWhenFileExist(properties, configPath);
} catch (IOException e) {
throw new IllegalArgumentException(String.format("Cannot load %s file from conf", EventMeshConstants.EVENTMESH_CONF_FILE));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org