示例#1
0
  /** 存储到props文件的格式中 */
  public void storeToProps() {
    FileOutputStream fos = null;
    try {
      fos = new FileOutputStream(configFile);
    } catch (FileNotFoundException e1) {
      System.out.println("文件未找到:" + configFile + e1.toString());
    }

    try {
      conf.store(fos, "");
    } catch (FileNotFoundException e) {
      System.err.println("配置文件" + configFile + "找不到!!\n" + e.toString());
    } catch (Exception e) {
      System.err.println("读取配置文件" + configFile + "错误!!\n" + e.toString());
    }
  }