openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r765390 - /incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
Date Wed, 15 Apr 2009 22:03:45 GMT
Author: struberg
Date: Wed Apr 15 22:03:45 2009
New Revision: 765390

URL: http://svn.apache.org/viewvc?rev=765390&view=rev
Log:
OWB-89 rework xmlLocations to contain the file paths only and no more open InputStreams

Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java?rev=765390&r1=765389&r2=765390&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
Wed Apr 15 22:03:45 2009
@@ -15,6 +15,7 @@
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.io.InputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
@@ -255,14 +256,29 @@
         while (it.hasNext())
         {
             String fileName = it.next();
+            FileInputStream fis = null;
             try
             {
-                this.xmlConfigurator.configure(new FileInputStream(fileName), fileName);
+                fis = new FileInputStream(fileName);
+                this.xmlConfigurator.configure(fis, fileName);
             } 
             catch (FileNotFoundException e)
             {
                 throw new WebBeansDeploymentException(e);
             }
+            finally
+            {
+                if (fis != null)
+                {
+                    try
+                    {
+                        fis.close();
+                    } catch (IOException e)
+                    {
+                        // all ok, ignore this!
+                    }
+                }
+            }
         }
 
         logger.info("Deploying configurations from XML is ended succesfully");



Mime
View raw message