* Johan Compagner:
> now we directly see the problem.. Who is responsible of closing
> that stream? When i walk through that code from newInputStream
> to Streams.readString() i don't see any closes.
I see your point now, I didn't notice FileResourceStream.close()
method. Please find updated patch attached.
--
Jean-Baptiste Quenot
aka John Banana Qwerty
http://caraldi.com/jbq/
--- src/java/wicket/util/resource/FileResourceStream.java.orig Fri May 5
15:09:00 2006
+++ src/java/wicket/util/resource/FileResourceStream.java Thu Jun 29
16:23:03 2006
@@ -85,7 +85,9 @@
}
/**
- * @return A readable input stream for this resource.
+ * @return A readable input stream for this resource. The same input
stream
+ * is returned until <tt>FileResourceStream.close()</tt> is invoked.
+ *
* @throws ResourceStreamNotFoundException
*/
public InputStream getInputStream() throws
ResourceStreamNotFoundException
--- src/java/wicket/util/resource/AbstractResourceStream.java.orig Fri May
5 15:05:10 2006
+++ src/java/wicket/util/resource/AbstractResourceStream.java Thu Jun 29
16:28:56 2006
@@ -71,6 +71,18 @@
{
throw new WicketRuntimeException("Unable to read
resource as String", e);
}
+ finally
+ {
+ // We're done with the input stream, close it
+ try
+ {
+ close();
+ }
+ catch (IOException ignored)
+ {
+ // Ignore this error, we are in a 'finally'
statement
+ }
+ }
}
/**
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user