You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/04/07 04:31:15 UTC

[GitHub] [shardingsphere] wl4g commented on a change in pull request #9958: Fix: unable to read configuration file when path contains Chinese

wl4g commented on a change in pull request #9958:
URL: https://github.com/apache/shardingsphere/pull/9958#discussion_r608332210



##########
File path: shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/config/ProxyConfigurationLoader.java
##########
@@ -64,9 +67,14 @@ public static YamlProxyConfiguration load(final String path) throws IOException
                 YamlProxyRuleConfiguration::getSchemaName, each -> each, (oldValue, currentValue) -> oldValue, LinkedHashMap::new)));
     }
     
-    private static File getResourceFile(final String path) {
+    private static File getResourceFile(final String path) throws IOException {
         URL url = ProxyConfigurationLoader.class.getResource(path);
-        return null == url ? new File(path) : new File(url.getFile());
+        if (null != url) {
+            // Fixed: the path contains Chinese yaml error.

Review comment:
       I agree.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org