Skip to content

Commit

Permalink
Merge pull request #43 from CoolGeo2016/patch-1
Browse files Browse the repository at this point in the history
Update ConfigYml.java
  • Loading branch information
TommyLemon committed Sep 20, 2018
2 parents b87051f + a5e72b7 commit 3d10465
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.ho.yaml.Yaml;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

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

0 comments on commit 3d10465

Please sign in to comment.