We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b87051f + a5e72b7 commit 3d10465Copy full SHA for 3d10465
APIJSON-Java-Server/APIJSONDemo_oracle/src/main/java/apijson/demo/server/config/ConfigYml.java
@@ -2,8 +2,8 @@
2
3
import org.ho.yaml.Yaml;
4
5
-import java.io.File;
6
import java.io.FileNotFoundException;
+import java.io.InputStream;
7
import java.util.HashMap;
8
import java.util.Map;
9
@@ -13,9 +13,8 @@
13
* @description
14
*/
15
public class ConfigYml {
16
- public Map read() {
17
- String fileName = this.getClass().getClassLoader().getResource("application.yml").getPath();//获取文件路径
18
- File dumpFile=new File(fileName);
+ public Map read() {
+ InputStream dumpFile = this.getClass().getClassLoader().getResourceAsStream("application.yml");
19
Map father = null;
20
try {
21
father = Yaml.loadType(dumpFile, HashMap.class);
0 commit comments