本文整理了Java中cn.hutool.core.io.FileUtil.getPrintWriter()
方法的一些代码示例,展示了FileUtil.getPrintWriter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.getPrintWriter()
方法的具体详情如下:
包路径:cn.hutool.core.io.FileUtil
类名称:FileUtil
方法名:getPrintWriter
[英]获得一个打印写入对象,可以有print
[中]获得一个打印写入对象,可以有打印
代码示例来源:origin: looly/hutool
/**
* 持久化当前设置,会覆盖掉之前的设置<br>
* 持久化会不会保留之前的分组
*
* @param absolutePath 设置文件的绝对路径
*/
public void store(String absolutePath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(absolutePath, charset, false);
store(writer);
} catch (IOException e) {
throw new IORuntimeException(e, "Store Setting to [{}] error!", absolutePath);
} finally {
IoUtil.close(writer);
}
}
代码示例来源:origin: looly/hutool
/**
* 持久化当前设置,会覆盖掉之前的设置<br>
* 持久化会不会保留之前的分组
*
* @param absolutePath 设置文件的绝对路径
*/
public void store(String absolutePath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(absolutePath, charset, false);
store(writer);
} catch (IOException e) {
throw new IORuntimeException(e, "Store Setting to [{}] error!", absolutePath);
} finally {
IoUtil.close(writer);
}
}
代码示例来源:origin: looly/hutool
/**
* 生成文件
*
* @param template 模板
* @param context 模板上下文
* @param destPath 目标路径(绝对)
*/
public static void toFile(Template template, VelocityContext context, String destPath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.OUTPUT_ENCODING).toString(), false);
merge(template, context, writer);
} catch (IORuntimeException e) {
throw new UtilException(e, "Write Velocity content to [{}] error!", destPath);
} finally {
IoUtil.close(writer);
}
}
代码示例来源:origin: looly/hutool
/**
* 生成文件
*
* @param template 模板
* @param context 模板上下文
* @param destPath 目标路径(绝对)
*/
public static void toFile(Template template, VelocityContext context, String destPath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.OUTPUT_ENCODING).toString(), false);
merge(template, context, writer);
} catch (IORuntimeException e) {
throw new UtilException(e, "Write Velocity content to [{}] error!", destPath);
} finally {
IoUtil.close(writer);
}
}
代码示例来源:origin: cn.hutool/hutool-setting
/**
* 持久化当前设置,会覆盖掉之前的设置<br>
* 持久化会不会保留之前的分组
*
* @param absolutePath 设置文件的绝对路径
*/
public void store(String absolutePath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(absolutePath, charset, false);
store(writer);
} catch (IOException e) {
throw new IORuntimeException(e, "Store Setting to [{}] error!", absolutePath);
} finally {
IoUtil.close(writer);
}
}
代码示例来源:origin: cn.hutool/hutool-all
/**
* 持久化当前设置,会覆盖掉之前的设置<br>
* 持久化会不会保留之前的分组
*
* @param absolutePath 设置文件的绝对路径
*/
public void store(String absolutePath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(absolutePath, charset, false);
store(writer);
} catch (IOException e) {
throw new IORuntimeException(e, "Store Setting to [{}] error!", absolutePath);
} finally {
IoUtil.close(writer);
}
}
代码示例来源:origin: cn.hutool/hutool-all
/**
* 生成文件
*
* @param template 模板
* @param context 模板上下文
* @param destPath 目标路径(绝对)
*/
public static void toFile(Template template, VelocityContext context, String destPath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.OUTPUT_ENCODING).toString(), false);
merge(template, context, writer);
} catch (IORuntimeException e) {
throw new UtilException(e, "Write Velocity content to [{}] error!", destPath);
} finally {
IoUtil.close(writer);
}
}
内容来源于网络,如有侵权,请联系作者删除!