Author: shane.bryzak(a)jboss.com
Date: 2009-04-02 17:22:40 -0400 (Thu, 02 Apr 2009)
New Revision: 10278
Modified:
trunk/src/remoting/org/jboss/seam/remoting/Remoting.java
Log:
JBSEAM-4075
Modified: trunk/src/remoting/org/jboss/seam/remoting/Remoting.java
===================================================================
--- trunk/src/remoting/org/jboss/seam/remoting/Remoting.java 2009-04-02 20:06:40 UTC (rev
10277)
+++ trunk/src/remoting/org/jboss/seam/remoting/Remoting.java 2009-04-02 21:22:40 UTC (rev
10278)
@@ -167,21 +167,29 @@
{
InputStream in = this.getClass().getClassLoader().getResourceAsStream(
"org/jboss/seam/remoting/" + resourceName);
-
- if (in != null)
+ try
{
- response.setContentType("text/javascript");
-
- byte[] buffer = new byte[1024];
- int read = in.read(buffer);
- while (read != -1)
+ if (in != null)
{
- response.getOutputStream().write(buffer, 0, read);
- read = in.read(buffer);
+ response.setContentType("text/javascript");
+
+ byte[] buffer = new byte[1024];
+ int read = in.read(buffer);
+ while (read != -1)
+ {
+ response.getOutputStream().write(buffer, 0, read);
+ read = in.read(buffer);
+ }
}
+ else
+ {
+ log.error(String.format("Resource [%s] not found.",
resourceName));
+ }
}
- else
- log.error(String.format("Resource [%s] not found.",
resourceName));
+ finally
+ {
+ if (in != null) in.close();
+ }
}
}
Show replies by date