felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1030478 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
Date Wed, 03 Nov 2010 14:49:39 GMT
Author: rickhall
Date: Wed Nov  3 14:49:38 2010
New Revision: 1030478

URL: http://svn.apache.org/viewvc?rev=1030478&view=rev
Log:
Can only lock writeable files, apparently. (FELIX-2646)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java?rev=1030478&r1=1030477&r2=1030478&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
Wed Nov  3 14:49:38 2010
@@ -105,7 +105,6 @@ public class BundleCache
         File lockFile = new File(cacheDir, CACHE_LOCK_NAME);
         FileChannel fc = null;
         FileOutputStream fos = null;
-        FileInputStream fis = null;
         try
         {
             if (!getSecureAction().fileExists(lockFile))
@@ -115,8 +114,8 @@ public class BundleCache
             }
             else
             {
-                fis = getSecureAction().getFileInputStream(lockFile);
-                fc = fis.getChannel();
+                fos = getSecureAction().getFileOutputStream(lockFile);
+                fc = fos.getChannel();
             }
         }
         catch (Exception ex)
@@ -124,7 +123,6 @@ public class BundleCache
             try
             {
                 if (fos != null) fos.close();
-                if (fis != null) fis.close();
                 if (fc != null) fc.close();
             }
             catch (Exception ex2)



Mime
View raw message