gconfig = new YamlConfiguration();
uconfig.load(ufile);
gconfig.load(gfile);
ConfigurationSection usersConfig = uconfig
.getConfigurationSection(USERS);
if (usersConfig != null) {
Set<String> names = usersConfig.getKeys(false);
for (String name : names) {
List<String> nPerm = usersConfig.getStringList(name + "."
+ PERMISSIONS);
List<String> nGroup = usersConfig.getStringList(name + "."
+ GROUPS);
Set<Permission> perms = Permission.loadFromString(nPerm);
// Create the new user
add(new User(name, nGroup, perms, this));
}
}
ConfigurationSection groupsConfig = gconfig
.getConfigurationSection(GROUPS);
if (groupsConfig != null) {
Set<String> names = groupsConfig.getKeys(false);
for (String name : names) {
List<String> nPerm = groupsConfig.getStringList(name + "."
+ PERMISSIONS);
List<String> nGroup = groupsConfig.getStringList(name + "."
+ GROUPS);
Set<Permission> perms = Permission.loadFromString(nPerm);
// Create the new group
this.add(new Group(name, nGroup, perms, this));
}