Esempio n. 1
0
  private void save() throws JDependException {

    FileOutputStream os = null;
    Properties properties = new Properties();
    try {
      properties.put("applyChildren", String.valueOf(conf.applyChildren));
      properties.put("childrenKeys", String.valueOf(conf.getChildrenKeys()));
      properties.put("applyLayer", String.valueOf(conf.applyLayer));
      if (conf.layer != null) {
        properties.put("layer", String.valueOf(conf.layer));
      } else {
        properties.put("layer", "");
      }

      File file = getDefaultPropertyFile();
      if (!file.exists()) {
        file.createNewFile();
      }
      os = new FileOutputStream(file);
      properties.store(os, "UTF-8");
    } catch (Exception e) {
      e.printStackTrace();
      LogUtil.getInstance(ComponentJudgeRepo.class).systemError("保存componentJudge配置信息出错。");
      throw new JDependException("保存componentJudge配置信息出错。", e);
    } finally {
      if (os != null) {
        try {
          os.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
  }