MCPcopy Create free account
hub / github.com/diyhi/bbs / autoWriteStringToFile

Method autoWriteStringToFile

src/main/java/cms/utils/FileUtil.java:606–616  ·  view source on GitHub ↗

写文件(如果目标文件不存在,FileUtils会自动创建) 自动路径 jar启动时使用外部路径 IDE启动时使用内部路径 @param path 路径 @param content 内容 @param encoding 编码 UTF-8 @param append 是否是追加模式

(String path,String content,String encoding, boolean append)

Source from the content-addressed store, hash-verified

604 * @param append 是否是追加模式
605 */
606 public static void autoWriteStringToFile(String path,String content,String encoding, boolean append){
607 try {
608 FileUtils.writeStringToFile(new File(PathUtil.autoRootPath()+File.separator+path), content, encoding,append);
609 } catch (IOException e) {
610 // TODO Auto-generated catch block
611 // e.printStackTrace();
612 if (logger.isErrorEnabled()) {
613 logger.error("写文件(如果目标文件不存在,FileUtils会自动创建)"+ path,e);
614 }
615 }
616 }
617 /**
618 * 删除文件 自动路径 jar启动时使用外部路径 IDE启动时使用内部路径
619 * @param path 路径

Callers

nothing calls this directly

Calls 2

autoRootPathMethod · 0.95
writeStringToFileMethod · 0.80

Tested by

no test coverage detected