We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在代码 com.baidu.disconf.client.support.utils.ConfigLoaderUtils#loadWithTomcatMode 没有关闭文件流, 虽然只打开一次. 但是这样写会不会还是不妥
private static Properties loadWithTomcatMode(final String propertyFilePath) throws Exception { Properties props = new Properties(); try { // 先用TOMCAT模式进行导入 // http://blog.csdn.net/minfree/article/details/1800311 // http://stackoverflow.com/questions/3263560/sysloader-getresource-problem-in-java URL url = ClassLoaderUtil.getLoader().getResource(propertyFilePath); URI uri = new URI(url.toString()); props.load(new InputStreamReader(new FileInputStream(uri.getPath()), "utf-8")); } catch (Exception e) { // http://stackoverflow.com/questions/574809/load-a-resource-contained-in-a-jar props.load(new InputStreamReader(ClassLoaderUtil.getLoader().getResourceAsStream(propertyFilePath), "utf-8")); } return props; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在代码 com.baidu.disconf.client.support.utils.ConfigLoaderUtils#loadWithTomcatMode
没有关闭文件流, 虽然只打开一次. 但是这样写会不会还是不妥
The text was updated successfully, but these errors were encountered: