public BundleReference installNestedBundle(Contribution contribution,
String bundleSymbolicName,
String bundleVersion) {
BundleReference bundleReference = null;
initialize();
if (osgiRuntime == null)
return null;
List<Artifact> artifacts = contribution.getArtifacts();
for (Artifact a : artifacts) {
if (a.getURI().endsWith(".jar")) {
InputStream stream;
JarInputStream jar = null;
Object name;
Object version;
try {
URL artifactURL = new URL(a.getLocation());
stream = artifactURL.openStream();
jar = new JarInputStream(artifactURL.openStream());
Manifest manifest = jar.getManifest();
name = manifest.getMainAttributes().get(new Attributes.Name("Bundle-SymbolicName"));
version = manifest.getMainAttributes().get(new Attributes.Name("Bundle-Version"));
if (bundleSymbolicName.equals(name) && (bundleVersion == null || version == null || bundleVersion
.equals(version))) {
Object bundle = osgiRuntime.installBundle(a.getLocation(), stream);
bundleReference = new BundleReference(bundle, bundleSymbolicName, bundleVersion, a.getURI());
break;
}
} catch (Exception e) {