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/26 11:54:41 UTC

[incubator-eventmesh] branch master updated: [ISSUE #1892]Use the methods that have been extracted [knative ConfigurationWrapper]

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 c226e3b8 [ISSUE #1892]Use the methods that have been extracted [knative ConfigurationWrapper]
     new 21ca6726 Merge pull request #1900 from xiewanlin/fix_patch_ConfigurationWrapper
c226e3b8 is described below

commit c226e3b879e5156563e45146699c8b5c30a4b2b5
Author: venlinxie <76...@qq.com>
AuthorDate: Wed Oct 26 19:38:01 2022 +0800

    [ISSUE #1892]Use the methods that have been extracted [knative ConfigurationWrapper]
---
 .../eventmesh/connector/knative/config/ConfigurationWrapper.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eventmesh-connector-plugin/eventmesh-connector-knative/src/main/java/org/apache/eventmesh/connector/knative/config/ConfigurationWrapper.java b/eventmesh-connector-plugin/eventmesh-connector-knative/src/main/java/org/apache/eventmesh/connector/knative/config/ConfigurationWrapper.java
index 962f520b..86d9ab7a 100644
--- a/eventmesh-connector-plugin/eventmesh-connector-knative/src/main/java/org/apache/eventmesh/connector/knative/config/ConfigurationWrapper.java
+++ b/eventmesh-connector-plugin/eventmesh-connector-knative/src/main/java/org/apache/eventmesh/connector/knative/config/ConfigurationWrapper.java
@@ -18,6 +18,7 @@
 package org.apache.eventmesh.connector.knative.config;
 
 import org.apache.eventmesh.common.Constants;
+import org.apache.eventmesh.common.utils.PropertiesUtils;
 import org.apache.eventmesh.connector.knative.common.EventMeshConstants;
 
 import org.apache.commons.lang3.StringUtils;
@@ -27,6 +28,7 @@ import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Properties;
 
 import lombok.experimental.UtilityClass;
@@ -62,7 +64,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, StandardCharsets.UTF_8);
             }
         } 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