Skip to content

Commit 3d10465

Browse files
authored
Merge pull request #43 from CoolGeo2016/patch-1
Update ConfigYml.java
2 parents b87051f + a5e72b7 commit 3d10465

File tree

1 file changed

+3
-4
lines changed
  • APIJSON-Java-Server/APIJSONDemo_oracle/src/main/java/apijson/demo/server/config

1 file changed

+3
-4
lines changed

APIJSON-Java-Server/APIJSONDemo_oracle/src/main/java/apijson/demo/server/config/ConfigYml.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import org.ho.yaml.Yaml;
44

5-
import java.io.File;
65
import java.io.FileNotFoundException;
6+
import java.io.InputStream;
77
import java.util.HashMap;
88
import java.util.Map;
99

@@ -13,9 +13,8 @@
1313
* @description
1414
*/
1515
public class ConfigYml {
16-
public Map read() {
17-
String fileName = this.getClass().getClassLoader().getResource("application.yml").getPath();//获取文件路径
18-
File dumpFile=new File(fileName);
16+
public Map read() {
17+
InputStream dumpFile = this.getClass().getClassLoader().getResourceAsStream("application.yml");
1918
Map father = null;
2019
try {
2120
father = Yaml.loadType(dumpFile, HashMap.class);

0 commit comments

Comments
 (0)