package apijson.demo.server.config;

import org.ho.yaml.Yaml;

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

/**
 * @author hjt
 * @date 2018/8/30
 * @description
 */
public class ConfigYml {
    public Map read() {
        String fileName = this.getClass().getClassLoader().getResource("application.yml").getPath();//获取文件路径
        File dumpFile=new File(fileName);
        Map father = null;
        try {
            father = Yaml.loadType(dumpFile, HashMap.class);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        return father;
    }
}

@@ -79,46 +79,53 @@
 File
-;%0Aimport java.io.FileNotFoundException
+NotFoundException;%0Aimport java.io.InputStream
 ;%0Aim
@@ -277,16 +277,24 @@
 read() %7B
+        
 %0A       
@@ -298,22 +298,27 @@
     
-String fileNam
+InputStream dumpFil
 e = 
@@ -361,16 +361,24 @@
 Resource
+AsStream
 (%22applic
@@ -392,68 +392,8 @@
 ml%22)
-.getPath();//%E8%8E%B7%E5%8F%96%E6%96%87%E4%BB%B6%E8%B7%AF%E5%BE%84%0A        File dumpFile=new File(fileName)
 ;%0A  

Update ConfigYml.java