コード例 #1
0
  protected void writeMappings() {
    StructuredDataArray sda = new StructuredDataArray();

    for (String profile : userMapping.keySet()) {
      if (!hasSuchProfile(profile)) continue;

      String conf = userMapping.get(profile);
      if (!GuiManager.mainWindow.getPanelManageUsers().hasConfWithName(conf)) continue;

      StructuredDataObject sdo = new StructuredDataObject();
      sdo.put("name", profile);
      sdo.put("conf", conf);

      sda.put(sdo);
    }

    File file = new File("profiles.conf");
    FileHelper.writeToFile(file, StructuredDataHelper.toJSONArray(sda).toString());
  }
コード例 #2
0
 protected void writeDefaultProfilesConfFile() {
   File file = new File("profiles.conf");
   FileHelper.writeToFile(file, "[]");
 }