info.aduna.io.IOUtil.writeProperties()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中info.aduna.io.IOUtil.writeProperties()方法的一些代码示例,展示了IOUtil.writeProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtil.writeProperties()方法的具体详情如下:
包路径:info.aduna.io.IOUtil
类名称:IOUtil
方法名:writeProperties

IOUtil.writeProperties介绍

[英]Write the specified properties to the specified file.
[中]将指定的属性写入指定的文件。

代码示例

代码示例来源:origin: info.aduna.commons/aduna-commons-io

/**
 * Write the specified properties to the specified file.
 * 
 * @param props
 *        the properties to write
 * @param file
 *        the file to write to
 * @throws IOException
 *         when the properties could not be written to the file properly
 */
public static void writeProperties(Properties props, File file, boolean includeDefaults)
  throws IOException
{
  writeProperties(props, new FileOutputStream(file), includeDefaults);
}

代码示例来源:origin: info.aduna.appbase/aduna-appbase-core

/**
   * Save configuration properties to a file.
   * 
   * @param props
   *        the configuration properties
   * @param file
   *        the file to write to
   * @throws IOException
   *         if the settings could not be saved because of an I/O problem
   */
  public static void saveConfigurationProperties(Properties props, File file, boolean includeDefaults)
    throws IOException
  {
    if (file.getParentFile().mkdirs() || file.getParentFile().canWrite()) {
      IOUtil.writeProperties(props, file, includeDefaults);
    }
  }
}

代码示例来源:origin: org.openrdf.sesame/sesame-config

/**
   * Save configuration properties to a file.
   * 
   * @param props
   *        the configuration properties
   * @param file
   *        the file to write to
   * @throws IOException
   *         if the settings could not be saved because of an I/O problem
   */
  public static void saveConfigurationProperties(Properties props, File file, boolean includeDefaults)
    throws IOException
  {
    if (file.getParentFile().mkdirs() || file.getParentFile().canWrite()) {
      IOUtil.writeProperties(props, file, includeDefaults);
    }
  }
}

相关文章