This is the first time I am working with YAML files, so the first think I looked at was to find any library that could help me to parse the file.
I have found two libraries, YamlBean and SnakeYAML. I am not sure which one that I am going to use.
Here is an example of the file that I am trying to parse:
users: user1: groups: - Premium user2: groups: - Mod user3: groups: - default groups: Mod: permissions: test: true inheritance: - Premium default: permissions: test.test: true inheritance: - Mod Admin: permissions: test.test.test: true inheritance: - Mod
The file will change dynamical so I don't know how many users or groups the file would contain.
The information I would like to fetch from this is the user name and the group like this:
user1 Premium user2 Mod user3 default
And from the groups only the group names, like this:
Mod default Admin
Anyone could get me started here? And what is the best library to use for this?
YamlBean or SnakeYAML?
I guess, I need to save the information in something that I easily could iterate over.