写文件(如果目标文件不存在,FileUtils会自动创建) 自动路径 jar启动时使用外部路径 IDE启动时使用内部路径 @param path 路径 @param content 内容 @param encoding 编码 UTF-8 @param append 是否是追加模式
(String path,String content,String encoding, boolean append)
| 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 路径 |
nothing calls this directly
no test coverage detected