当我没有放置命令行参数时,我可以写入该文件但是每当我放置命令行参数时它都不会写入。即使我甚至没有使用命令行参数。
get_view_post:
path: /blog/get/one/post/{id}/
defaults: { _controller: "MyAppBlogBundle:Blog:getpost" }
Update_comment:
path: /blog/get/post/Comment/Update/View/{idc}
defaults: { _controller: "MyAppBlogBundle:Blog:UpdateComment" }
答案 0 :(得分:1)
您需要flush
RAM
到HDD|SSD
的数据,所以:
try (FileWriter fw = new FileWriter(file.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw)) {
// Write the data to the memory
bw.write(content);
// You need to flush the data
bw.flush();
// Close the BufferedWriter
bw.close();
} catch (Exception ex) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "Failed to write the data on the file", ex);
}