SyntaxFix
Write A Post
Hire A Developer
Questions
Make sure that the directory exists, you have permission to access it and add the file to the path to write the log:
File file = new File("D:/Data/" + item.getFileName());