class YamlUtil {

	public static LinkedHashMap<String, String> getYmlByFileName(String filename)
		throws FileNotFoundException {
		result = new LinkedHashMap<String, String>();
		if (filename == null) {
			filename = YAMLFILE;
		}

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

		// 2-- 创建Yaml对象，初始化yaml解析器，所有的解析操作都是从这个对象开始
		Yaml props = new Yaml();

		// 3-- 加载文件数据并解析
		// 3--1 载入文件数据
		Map<String, Object> param = props.loadAs(fis, Map.class);

		/*Object obj = props.loadAs(fis, Map.class);
		Map<String, Object> param = (Map<String, Object>) obj;*/

		// 3--2 遍历载入的文件数据
		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());
			}
		}

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

}