cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevend...@apache.org
Subject svn commit: r770142 - /cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/FileReaderComponent.java
Date Thu, 30 Apr 2009 10:14:30 GMT
Author: stevendolg
Date: Thu Apr 30 10:14:30 2009
New Revision: 770142

URL: http://svn.apache.org/viewvc?rev=770142&view=rev
Log:
Changed constructCacheKey to make sure that the URLConnection is closed after created the
CacheKey.

Modified:
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/FileReaderComponent.java

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/FileReaderComponent.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/FileReaderComponent.java?rev=770142&r1=770141&r2=770142&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/FileReaderComponent.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/FileReaderComponent.java
Thu Apr 30 10:14:30 2009
@@ -51,7 +51,9 @@
     public CacheKey constructCacheKey() {
         try {
             URLConnection connection = this.source.openConnection();
-            return new TimestampCacheKey(this.source, connection.getLastModified());
+            TimestampCacheKey timestampCacheKey = new TimestampCacheKey(this.source, connection.getLastModified());
+            URLConnectionUtils.closeQuietly(connection);
+            return timestampCacheKey;
         } catch (IOException e) {
             this.logger.error("Can't construct cache key. Error while connecting to " + this.source,
e);
         }



Mime
View raw message