felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r423928 - /incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
Date Thu, 20 Jul 2006 13:20:06 GMT
Author: rickhall
Date: Thu Jul 20 06:20:05 2006
New Revision: 423928

URL: http://svn.apache.org/viewvc?rev=423928&view=rev
Log:
Previous changes to BundleArchive starting saving the revision location to
the revision directory, however, when installing exploded bundle directories
the revision directory was not created since it previously wasn't necessary.
Now it is necessary to create the revision directory for referenced
directories because bundle archive needs some place to save the revision
location. Thus, modified DirectoryRevision to create its revision directory.

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

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java?rev=423928&r1=423927&r2=423928&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
(original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
Thu Jul 20 06:20:05 2006
@@ -44,6 +44,24 @@
         m_refDir = new File(location.substring(
             location.indexOf(BundleArchive.FILE_PROTOCOL)
                 + BundleArchive.FILE_PROTOCOL.length()));
+
+        // If the revision directory exists, then we don't
+        // need to initialize since it has already been done.
+        if (BundleCache.getSecureAction().fileExists(getRevisionRootDir()))
+        {
+            return;
+        }
+
+        // Create revision directory, we only need this to store the
+        // revision location, since nothing else needs to be extracted
+        // since we are referencing a read directory already.
+        if (!BundleCache.getSecureAction().mkdir(getRevisionRootDir()))
+        {
+            getLogger().log(
+                Logger.LOG_ERROR,
+                getClass().getName() + ": Unable to create revision directory.");
+            throw new IOException("Unable to create archive directory.");
+        }
     }
 
     public synchronized Map getManifestHeader()



Mime
View raw message