I have the following file
/app/menus/menu1.yml
and I\'d like to read it\'s contents
--
short answer:
fileConten
Play includes the SnakeYAML parser. From their docs:
Yaml yaml = new Yaml();
String document = "\n- Hesperiidae\n- Papilionidae\n- Apatelodidae\n- Epiplemidae";
List list = (List) yaml.load(document);
System.out.println(list);
['Hesperiidae', 'Papilionidae', 'Apatelodidae', 'Epiplemidae']
There is also a version of Yaml.load
that takes an InputStream
, which is demonstrated in this sample code: http://code.google.com/p/snakeyaml/source/browse/src/test/java/examples/LoadExampleTest.java