Remove some unnecessary clutter from the log While ((line = reader.readLine()) != null) If (currentLoopModified > lastLoopModified)īufferedReader reader = new BufferedReader(new FileReader('C:/Documents and Settings/Cuckoo/Desktop/Syss-convos.LOG')) įileWriter output = new FileWriter('C:/Documents and Settings/Cuckoo/Desktop/Conversations.html') Public static void main(String args) throws IOException, InterruptedExceptionĬurrentLoopModified = new File('C:/Documents and Settings/Cuckoo/Desktop/Syss-convos.LOG').lastModified() Here is the code which is throwing the error: import java.io.* The first iteration of the loop seems to execute fine, and then it sleeps for 5 minutes and throws the following error: java.io.IOException: Stream closedĪt java.io.BufferedWriter.ensureOpen(BufferedWriter.java:116)Īt java.io.BufferedWriter.write(BufferedWriter.java:221)Īt java.io.Writer.append(Writer.java:227)Īt PrintOutConvosFtp3.main(PrintOutConvosFtp3.java:130) I believe the issue is something to do with the Writer, but I am not understanding what is happening here. I have written the following block of code which picks up a plaintext file, and if the current modified date on the file is greater than the last iteration of the loop, parse the file into an HTML version and upload it to an ftp server.