写文件(如果目标文件不存在,FileUtils会自动创建) @param path 路径 @param content 内容 @param encoding 编码 UTF-8 @param append 是否是追加模式
(String path,String content,String encoding, boolean append)
| 195 | * @param append 是否是追加模式 |
| 196 | */ |
| 197 | public static void writeStringToFile(String path,String content,String encoding, boolean append){ |
| 198 | |
| 199 | try { |
| 200 | FileUtils.writeStringToFile(new File(PathUtil.defaultExternalDirectory()+File.separator+path), content, encoding,append); |
| 201 | } catch (IOException e) { |
| 202 | // TODO Auto-generated catch block |
| 203 | // e.printStackTrace(); |
| 204 | if (logger.isErrorEnabled()) { |
| 205 | logger.error("写文件(如果目标文件不存在,FileUtils会自动创建)"+ path,e); |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | |
| 211 |