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/11/29 02:11:57 UTC

[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #13834: fix file not found in windows os: config path with blank character re…

TeslaCN commented on a change in pull request #13834:
URL: https://github.com/apache/shardingsphere/pull/13834#discussion_r757996560



##########
File path: shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/config/ProxyConfigurationLoader.java
##########
@@ -53,18 +54,19 @@
      * @param path configuration path of ShardingSphere-Proxy
      * @return configuration of ShardingSphere-Proxy
      * @throws IOException IO exception
+     * @throws URISyntaxException URI syntax exception
      */
-    public static YamlProxyConfiguration load(final String path) throws IOException {
+    public static YamlProxyConfiguration load(final String path) throws IOException, URISyntaxException {
         YamlProxyServerConfiguration serverConfig = loadServerConfiguration(getResourceFile(String.join("/", path, SERVER_CONFIG_FILE)));
         File configPath = getResourceFile(path);
         Collection<YamlProxyRuleConfiguration> ruleConfigs = loadRuleConfigurations(configPath);
         return new YamlProxyConfiguration(serverConfig, ruleConfigs.stream().collect(Collectors.toMap(
                 YamlProxyRuleConfiguration::getSchemaName, each -> each, (oldValue, currentValue) -> oldValue, LinkedHashMap::new)));
     }
     
-    private static File getResourceFile(final String path) {
+    private static File getResourceFile(final String path) throws URISyntaxException {

Review comment:
       I prefer using `@SneakyThrow(URISyntaxException.class)` here.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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