This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new f67bffd8d7f optimize PluginConfigurationLoader (#26424)
f67bffd8d7f is described below

commit f67bffd8d7f2140ad6a20d449fb1d257f04502ce
Author: jiangML <[email protected]>
AuthorDate: Mon Jun 19 11:24:40 2023 +0800

    optimize PluginConfigurationLoader (#26424)
---
 .../agent/core/plugin/config/PluginConfigurationLoader.java          | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/config/PluginConfigurationLoader.java
 
b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/config/PluginConfigurationLoader.java
index 05aa741a5a1..2eb9ea4195a 100644
--- 
a/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/config/PluginConfigurationLoader.java
+++ 
b/agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/config/PluginConfigurationLoader.java
@@ -25,6 +25,7 @@ import 
org.apache.shardingsphere.agent.core.plugin.config.yaml.swapper.YamlPlugi
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Paths;
 import java.util.Collections;
 import java.util.Map;
 
@@ -34,8 +35,6 @@ import java.util.Map;
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class PluginConfigurationLoader {
     
-    private static final String CONFIG_PATH = "/conf/agent.yaml";
-    
     /**
      * Load plugin configurations.
      *
@@ -44,6 +43,6 @@ public final class PluginConfigurationLoader {
      * @throws IOException IO exception
      */
     public static Map<String, PluginConfiguration> load(final File 
agentRootPath) throws IOException {
-        return YamlPluginConfigurationLoader.load(new File(agentRootPath, 
CONFIG_PATH)).map(YamlPluginsConfigurationSwapper::swap).orElse(Collections.emptyMap());
+        return YamlPluginConfigurationLoader.load(new File(agentRootPath, 
Paths.get("conf", 
"agent.yaml").toString())).map(YamlPluginsConfigurationSwapper::swap).orElse(Collections.emptyMap());
     }
 }

Reply via email to