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

Method writeStringToFile

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

写文件(如果目标文件不存在,FileUtils会自动创建) @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

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

Callers 10

addMethod · 0.95
treatmentThumbnailMethod · 0.95
addThumbnailMethod · 0.95
deleteThumbnailMethod · 0.95
installMethod · 0.80
removeDirectoryMethod · 0.80
autoWriteStringToFileMethod · 0.80
autoDeleteFileMethod · 0.80
deleteFileMethod · 0.80

Calls 1

Tested by 1

installMethod · 0.64