karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [1/2] karaf git commit: [KARAF-3779] Be able to define the location of the kar storage
Date Fri, 27 Jan 2017 16:40:00 GMT
Repository: karaf
Updated Branches:
  refs/heads/master 90ef2e819 -> 58da8340b


[KARAF-3779] Be able to define the location of the kar storage


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/58da8340
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/58da8340
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/58da8340

Branch: refs/heads/master
Commit: 58da8340b0707bdba8d358a1e4a445727385d97d
Parents: 9864fb5
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Fri Jan 27 17:38:32 2017 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Fri Jan 27 17:39:44 2017 +0100

----------------------------------------------------------------------
 .../src/main/resources/resources/etc/org.apache.karaf.kar.cfg | 7 ++++++-
 .../java/org/apache/karaf/kar/internal/KarServiceImpl.java    | 4 ++--
 .../java/org/apache/karaf/kar/internal/osgi/Activator.java    | 3 ++-
 3 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/58da8340/assemblies/features/framework/src/main/resources/resources/etc/org.apache.karaf.kar.cfg
----------------------------------------------------------------------
diff --git a/assemblies/features/framework/src/main/resources/resources/etc/org.apache.karaf.kar.cfg
b/assemblies/features/framework/src/main/resources/resources/etc/org.apache.karaf.kar.cfg
index 6c7cf16..dfe491d 100644
--- a/assemblies/features/framework/src/main/resources/resources/etc/org.apache.karaf.kar.cfg
+++ b/assemblies/features/framework/src/main/resources/resources/etc/org.apache.karaf.kar.cfg
@@ -21,4 +21,9 @@
 # Enable or disable the refresh of the bundles when installing
 # the features contained in a KAR file
 #
-noAutoRefreshBundles=false
\ No newline at end of file
+noAutoRefreshBundles=false
+
+#
+# Directory where the kar are stored (when downloaded from Maven for instance)
+#
+#karStorage=${karaf.data}/kar
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/58da8340/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
----------------------------------------------------------------------
diff --git a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
index 1b73165..f769fc8 100644
--- a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
+++ b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
@@ -74,9 +74,9 @@ public class KarServiceImpl implements KarService {
     private AtomicBoolean busy;
     private DelayedDeployerThread delayedDeployerThread;
 
-    public KarServiceImpl(String karafBase, String karafData, FeaturesService featuresService)
{
+    public KarServiceImpl(String karafBase, String karStorage, FeaturesService featuresService)
{
         this.base = new File(karafBase);
-        this.storage = new File(new File(karafData), "kar");
+        this.storage = new File(karStorage);
         this.featuresService = featuresService;
         this.storage.mkdirs();
         if (!storage.isDirectory()) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/58da8340/kar/src/main/java/org/apache/karaf/kar/internal/osgi/Activator.java
----------------------------------------------------------------------
diff --git a/kar/src/main/java/org/apache/karaf/kar/internal/osgi/Activator.java b/kar/src/main/java/org/apache/karaf/kar/internal/osgi/Activator.java
index d61d9b9..968ebe0 100644
--- a/kar/src/main/java/org/apache/karaf/kar/internal/osgi/Activator.java
+++ b/kar/src/main/java/org/apache/karaf/kar/internal/osgi/Activator.java
@@ -41,10 +41,11 @@ public class Activator extends BaseActivator implements ManagedService
{
         }
 
         boolean noAutoRefreshBundles = getBoolean("noAutoRefreshBundles", false);
+        String karStorage = getString("karStorage", System.getProperty("karaf.data") + "/kar");
 
         KarServiceImpl karService = new KarServiceImpl(
                 System.getProperty("karaf.base"),
-                System.getProperty("karaf.data"),
+                karStorage,
                 featuresService
         );
         karService.setNoAutoRefreshBundles(noAutoRefreshBundles);


Mime
View raw message