private BundleHandle installBundle(String location, VirtualFile virtualFile) throws BundleException, IOException { BundleInfo info = BundleInfo.createBundleInfo(virtualFile); URL streamURL = info.getRoot().getStreamURL(); return installBundle(location, streamURL); }
@Override public void startBundleRefresh(XBundle bundle) throws BundleException { this.bundle = bundle; XBundleRevision brev = bundle.getBundleRevision(); Deployment deployment = bundle.adapt(Deployment.class); try { InputStream inputStream = deployment.getRoot().getStreamURL().openStream(); rootFile = AbstractVFS.toVirtualFile(inputStream); } catch (IOException ex) { throw FrameworkMessages.MESSAGES.cannotObtainVirtualFile(ex); } bundle.putAttachment(BUNDLE_REFRESHING_KEY, Boolean.TRUE); undeployRevision(brev); }
@Override OSGiBundle installBundleInternal(BundleInfo info) throws BundleException { try { String location = info.getLocation(); String streamURL = info.getRoot().getStreamURL().toExternalForm(); long bundleId = getFrameworkMBean().installBundleFromURL(location, streamURL); return new RemoteBundle(this, bundleId); } catch (RuntimeException rte) { throw rte; } catch (Exception ex) { throw new BundleException("Cannot install: " + info, ex); } }