Hi,

To followup on this issue:

[ 1485695 ] Allow to reinvoke FileResourceStream.getInputStream(),

I'm attaching a new patch against Wicket 1.2-rc1 that keeps
backwards compatibility on FileResourceStream.getInputStream(),
but fixes AbstractResourceStream.asString() to allow for multiple
invocations.

Note:  Logins to SourceForge.net are currently disabled.  That's
why I'm attaching the patch here.


However I didn't get a reply about the Velocity stuff.  Is there a
maintainer for this contrib component?


Also, have you been able to review this issue:

[ 1493672 ] Handle String array in PageParameters

Basically it allows to pass arrays in the parameters of a page.


Thanks in advance,
-- 
     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       Wed Jun 28 
16:08:32 2006
@@ -85,24 +85,36 @@
        }
 
        /**
-        * @return A readable input stream for this resource.
+        * @return A readable input stream for this resource.  If this method 
has
+        * already been invoked, the same input stream is returned.  This 
method has
+        * been kept for backwards compatibility.
+        *
         * @throws ResourceStreamNotFoundException
         */
        public InputStream getInputStream() throws 
ResourceStreamNotFoundException
        {
                if (inputStream == null)
                {
-                       try
-                       {
-                               inputStream = new FileInputStream(file);
-                       }
-                       catch (FileNotFoundException e)
-                       {
-                               throw new 
ResourceStreamNotFoundException("Resource " + file + " could not be found", e);
-                       }
+                       inputStream = newInputStream();
                }
 
                return inputStream;
+       }
+
+       /**
+        * @return A newly-created readable input stream for this resource.
+        * @throws ResourceStreamNotFoundException
+        */
+       public InputStream newInputStream() throws 
ResourceStreamNotFoundException
+       {
+               try
+               {
+                       return new FileInputStream(file);
+               }
+               catch (FileNotFoundException e)
+               {
+                       throw new ResourceStreamNotFoundException("Resource " + 
file + " could not be found", e);
+               }
        }
 
        /**
--- src/java/wicket/util/resource/AbstractResourceStream.java.orig      Fri May 
 5 15:05:10 2006
+++ src/java/wicket/util/resource/AbstractResourceStream.java   Wed Jun 28 
16:17:52 2006
@@ -56,11 +56,11 @@
                {
                        if (charset == null)
                        {
-                               return Streams.readString(new 
InputStreamReader(getInputStream()));
+                               return Streams.readString(new 
InputStreamReader(newInputStream()));
                        }
                        else
                        {
-                               return Streams.readString(new 
InputStreamReader(getInputStream(), charset));
+                               return Streams.readString(new 
InputStreamReader(newInputStream(), charset));
                        }
                }
                catch (IOException e)
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

Reply via email to