package kr.co.swh.lecture.opensource.yaml;


import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Map;

import org.yaml.snakeyaml.Yaml;


/**
 * <pre>
 * 패키지명 : kr.co.swh.lecture.opensource.yaml
 * 파일명 : FileRead.java
 * 설명 : FileRead
 * 
 * </pre>
 * 
 * @since : 2022. 4. 27.
 * @author : tobby48
 * @version : v1.0
 */
public class FileRead {
	
	public static void main(String[] args){
		try { 
			Yaml yaml = new Yaml();
			Map<String, Object> propMap = yaml.load(new FileReader("samples.yml")); 
			System.out.println(propMap); 
			System.out.println(propMap.get("cars"));
			Map<String, Object> cars = (Map<String, Object>) propMap.get("cars");
			System.out.println(cars.get("big")); 
		}catch(FileNotFoundException e) {
			e.printStackTrace();
		}
	}
}
