diff servlet/src/digilib/pdf/PDFFileWorker.java @ 801:72662bb585ba stream

remove all ServletOutputStream.flush(). (stupid me ;-)
author robcast
date Sat, 19 Feb 2011 11:07:08 +0100
parents fd2ef7e46119
children
line wrap: on
line diff
--- a/servlet/src/digilib/pdf/PDFFileWorker.java	Sat Feb 19 09:56:18 2011 +0100
+++ b/servlet/src/digilib/pdf/PDFFileWorker.java	Sat Feb 19 11:07:08 2011 +0100
@@ -46,10 +46,18 @@
     }
     
     public File call() throws Exception {
-    	OutputStream outstream = streamWorker.call();
-    	outstream.flush();
-    	// move temporary to final file
-    	tempFile.renameTo(finalFile);
+        OutputStream outstream = null;
+        try {
+            outstream = streamWorker.call();
+            outstream.flush();
+            outstream.close();
+            // move temporary to final file
+            tempFile.renameTo(finalFile);
+        } finally {
+            if (outstream != null) {
+                outstream.close();
+            }
+        }
         return finalFile;
     }