Author: michiel
Date: 2009-05-29 14:37:29 +0200 (Fri, 29 May 2009)
New Revision: 35509

Modified:
   mmbase/trunk/src/org/mmbase/util/SerializableInputStream.java
Log:
After writing to a file a FileItem get's size 0 (if above sizelimit). So this 
was a bug. (Failed a test-case)

Modified: mmbase/trunk/src/org/mmbase/util/SerializableInputStream.java
===================================================================
--- mmbase/trunk/src/org/mmbase/util/SerializableInputStream.java       
2009-05-29 12:37:03 UTC (rev 35508)
+++ mmbase/trunk/src/org/mmbase/util/SerializableInputStream.java       
2009-05-29 12:37:29 UTC (rev 35509)
@@ -78,6 +78,9 @@
     }
 
     public SerializableInputStream(FileItem fi) throws IOException {
+        this.size = fi.getSize();
+        this.name = fi.getName();
+        this.contentType = fi.getContentType();
         file = File.createTempFile(getClass().getName(), this.name);
         try {
             fi.write(file);
@@ -86,9 +89,6 @@
             ioe.initCause(e);
             throw ioe;
         }
-        this.size = fi.getSize();
-        this.name = fi.getName();
-        this.contentType = fi.getContentType();
         this.wrapped = new FileInputStream(file);
 
 

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to