From: Mathieu Baudier Date: Sat, 27 Oct 2012 14:01:55 +0000 (+0000) Subject: Opens OSGiBoot X-Git-Tag: argeo-commons-2.1.30~793 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=e13785786edb6cb45fd5598916e64b72cbb1bfc1;p=lgpl%2Fargeo-commons.git Opens OSGiBoot git-svn-id: https://svn.argeo.org/commons/trunk@5671 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java b/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java index 6b5103871..7e608103c 100644 --- a/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java +++ b/base/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java @@ -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;