incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r707080 - /incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/WatchedFolder.java
Date Wed, 22 Oct 2008 13:55:39 GMT
Author: bdelacretaz
Date: Wed Oct 22 06:55:38 2008
New Revision: 707080

URL: http://svn.apache.org/viewvc?rev=707080&view=rev
Log:
make sure the resource InputStream is closed

Modified:
    incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/WatchedFolder.java

Modified: incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/WatchedFolder.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/WatchedFolder.java?rev=707080&r1=707079&r2=707080&view=diff
==============================================================================
--- incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/WatchedFolder.java
(original)
+++ incubator/sling/trunk/extensions/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/jcr/impl/WatchedFolder.java
Wed Oct 22 06:55:38 2008
@@ -158,10 +158,20 @@
         	    }
         	} else {
         		// a single failure must not block the whole thing (SLING-655)
+        	    InputStream is = null;
         		try {
-        			installOrUpdate(n.getPath(), dp.getInputStream(), dp.getLastModified());
+        		    is = dp.getInputStream();
+        			installOrUpdate(n.getPath(), is, dp.getLastModified());
         		} catch(JcrInstallException jie) {
         			log.warn("Failed to install resource " + n.getPath(), jie);
+        		} finally {
+        		    if(is != null) {
+        		        try {
+        		            is.close();
+        		        } catch(IOException ioe) {
+        		            log.warn("IOException while closing stream of node " + n.getPath(),
ioe);
+        		        }
+        		    }
         		}
         	}
         }



Mime
View raw message