Exemplo n.º 1
0
  protected void readProfilesConf() {
    userMapping.clear();

    File file = new File("profiles.conf");
    String content = FileHelper.getFileContentAsString(file);

    JSONArray json = new JSONArray(content);
    StructuredDataArray sda = StructuredDataHelper.fromJSONArray(json).toStructuredDataArray();

    for (Object object : sda) {
      if (!(object instanceof StructuredDataObject)) continue;

      StructuredDataObject sdo = (StructuredDataObject) object;
      String name = sdo.getString("name");
      String confName = sdo.getString("conf");

      if (hasSuchProfile(name)) userMapping.put(name, confName);
    }
  }