class YamlUtil {

	public static List<LinkedHashMap<String, String>> getYmlByFileNamePerfect(String filename)
		throws FileNotFoundException {
		resultArray = new ArrayList<>();
		if (filename == null) {
			filename = YAMLFILE;
		}

		// 1-- 获取文件流
		File file = new File(filename);
		FileInputStream fis = new FileInputStream(file);

		// 2-- 实例化yaml解析器
		Yaml yaml = new Yaml();

		// 3-- 加载文件数据并解析
		Iterable<Object> ret = yaml.loadAll(fis);
		// 3--1 遍历Obejct迭代对象
		for (Object o:ret) {
			//System.out.println(o);
			result = new LinkedHashMap<String, String>();

			// 3--2 解析对象内容
			Map<String, Object> param = (Map<String, Object>) o;
			for (Map.Entry<String, Object> entry:param.entrySet()) {
				String key = entry.getKey();
				Object val = entry.getValue();
				if (val instanceof Map) {
					forEachYaml(key, (Map<String, Object>) val);
				} else {
					result.put(key, val.toString());
				}
			}
			resultArray.add(result);
		}

		// 4-- 响应解析结果
		return resultArray;
	}

}