Opens OSGiBoot
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 27 Oct 2012 14:01:55 +0000 (14:01 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 27 Oct 2012 14:01:55 +0000 (14:01 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@5671 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java

index 6b51038718bb28e35cd14b830c56ded2669e1506..7e608103c23c8fbf08de4fa0038fd02c4be77b2c 100644 (file)
@@ -189,6 +189,14 @@ public class OsgiBoot {
        /*
         * INSTALLATION
         */
+       /** Install a single url. Convenience method. */
+       public Bundle installUrl(String url) {
+               List urls = new ArrayList();
+               urls.add(url);
+               installUrls(urls);
+               return (Bundle) getBundlesByLocation().get(url);
+       }
+
        /** Install the bundles at this URL list. */
        public void installUrls(List urls) {
                Map installedBundles = getBundlesByLocation();
@@ -496,15 +504,23 @@ public class OsgiBoot {
         * effects.
         */
        public List getBundlesUrls() {
-               String baseUrl = OsgiBootUtils.getProperty(PROP_ARGEO_OSGI_BASE_URL,
-                               DEFAULT_BASE_URL);
                String bundlePatterns = OsgiBootUtils
                                .getProperty(PROP_ARGEO_OSGI_BUNDLES);
+               return getBundlesUrls(bundlePatterns);
+       }
+
+       /**
+        * Compute alist of URLs to install based on the provided patterns, with
+        * default base url
+        */
+       public List getBundlesUrls(String bundlePatterns) {
+               String baseUrl = OsgiBootUtils.getProperty(PROP_ARGEO_OSGI_BASE_URL,
+                               DEFAULT_BASE_URL);
                return getBundlesUrls(baseUrl, bundlePatterns);
        }
 
        /** Implements the path matching logic */
-       public List getBundlesUrls(String baseUrl, String bundlePatterns) {
+       List getBundlesUrls(String baseUrl, String bundlePatterns) {
                List urls = new ArrayList();
                if (bundlePatterns == null)
                        return urls;