Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2006-12-07 22:19:31 +0000
committerThomas Watson2006-12-07 22:19:31 +0000
commit042b172de6ee923b31789a609af5550639b3d8e1 (patch)
treec275459cf7a3da05d56dae0c743d801c5e1f9129
parent83837bff498dfe5a7899859bf7f38c50fac171ab (diff)
downloadrt.equinox.framework-042b172de6ee923b31789a609af5550639b3d8e1.tar.gz
rt.equinox.framework-042b172de6ee923b31789a609af5550639b3d8e1.tar.xz
rt.equinox.framework-042b172de6ee923b31789a609af5550639b3d8e1.zip
Bug 159629 Request to allow profile selection from a profile in osgi jar bundle
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
index 612c4c1d8..abbcdd43a 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
@@ -385,18 +385,17 @@ public class Framework implements EventDispatcher, EventPublisher {
// we assume a URL
url = new URL(propJavaProfile);
} catch (MalformedURLException e1) {
- // TODO consider logging ...
+ // try using a relative path in the system bundle
+ url = findInSystemBundle(propJavaProfile);
}
if (url == null && vmProfile != null) {
// look for a profile in the system bundle based on the vm profile
String javaProfile = vmProfile + ".profile"; //$NON-NLS-1$
- url = systemBundle.getEntry(javaProfile);
- if (url == null) {
- // Check the ClassLoader in case we're launched off the Java boot classpath
- ClassLoader loader=getClass().getClassLoader();
- url = loader==null ? ClassLoader.getSystemResource(javaProfile) : loader.getResource(javaProfile);
- }
+ url = findInSystemBundle(javaProfile);
}
+ if (url == null)
+ // the profile url is still null then use the osgi min profile in OSGi by default
+ url = findInSystemBundle("OSGi_Minimum-1.0.profile"); //$NON-NLS-1$
if (url != null) {
InputStream in = null;
try {
@@ -423,6 +422,16 @@ public class Framework implements EventDispatcher, EventPublisher {
return result;
}
+ private URL findInSystemBundle(String entry) {
+ URL result = systemBundle.getEntry(entry);
+ if (result == null) {
+ // Check the ClassLoader in case we're launched off the Java boot classpath
+ ClassLoader loader = getClass().getClassLoader();
+ result = loader == null ? ClassLoader.getSystemResource(entry) : loader.getResource(entry);
+ }
+ return result;
+ }
+
/**
* This method return the state of the framework.
*

Back to the top