protected Bundle doRun( final InputStream bundleStream ) throws BundleException { bundle.update( bundleStream ); return bundle; }
protected Bundle doRun( final InputStream bundleStream ) throws BundleException { bundle.update( bundleStream ); return bundle; }
public void update() throws BundleException { Bundle current = systemBundle; if (current == null) return; current.update(); }
public void update(InputStream input) throws BundleException { bundle.update(input); } }
public void update() throws BundleException { Bundle current = systemBundle; if (current == null) return; current.update(); }
public void updateFromUrl(String url) throws MalformedURLException, BundleException, IOException { //TODO should we use url handler service? bundle.update(new URL(url).openStream()); } public void refreshBundle() throws BundleNotAvailableException, ServiceNotAvailableException {
private void update(Bundle bundle, URL location) throws IOException, BundleException { try (InputStream is = location.openStream()) { if (raw) { bundle.update(is); } else { File file = BundleUtils.fixBundleWithUpdateLocation(is, location.toString()); try (FileInputStream fis = new FileInputStream(file)) { bundle.update(fis); } file.delete(); } } }
private void update(Bundle bundle, URL location) throws IOException, BundleException { try (InputStream is = location.openStream()) { File file = BundleUtils.fixBundleWithUpdateLocation(is, location.toString()); try (FileInputStream fis = new FileInputStream(file)) { bundle.update(fis); } file.delete(); } }
public void update(Long [] id) { try { bc.getBundle(id[0].longValue()).update(); } catch (BundleException e) { e.printStackTrace(); } }
public void updateBundleFromUrl(String bundleSymbolicName, String url) throws BundleException, BundleNotAvailableException, MalformedURLException, IOException { long id = InstrumentationSupport.getBundleId(bundleSymbolicName, ac); ac.getBundleContext().getBundle(id).update((new URL(url)).openStream()); }
@Override public void updateBundle(Bundle bundle, String uri, InputStream is) throws BundleException { // We need to wrap the bundle to insert a Bundle-UpdateLocation header try { File file = BundleUtils.fixBundleWithUpdateLocation(is, uri); bundle.update(new FileInputStream(file)); file.delete(); } catch (IOException e) { throw new BundleException("Unable to update bundle", e); } }
public void updateBundle(String bundleSymbolicName) throws BundleException, BundleNotAvailableException { long id = InstrumentationSupport.getBundleId(bundleSymbolicName, ac); ac.getBundleContext().getBundle(id).update(); }
public void restartFramework() throws NotImplementedException { try { ac.getBundleContext().getBundle(0).update(); } catch (BundleException be) { throw new NotImplementedException( "Restarting not implemented in this framework", be); } }
@Override public Result call() throws Exception { try { logger().info("Updating bundle {} from {}", bundle.getSymbolicName(), bundle.getLocation()); bundle.update(); return ok(); } catch (BundleException e) { logger().error("Cannot update bundle {}", bundle.getSymbolicName(), e); return badRequest(e); } } });
public String update() throws BundleException { Bundle bundle = osgiHost.getBundles().get(id); try { bundle.update(); } catch (Exception e) { addActionError(e.toString()); } return view(); }
public void refresh() { URI location = md.getLocations()[0]; File f = new File(location); if (f.lastModified() > bundle.getLastModified()) { try { bundle.update(); registry.getPackageAdmin().refreshPackages(new Bundle[]{bundle}); } catch (BundleException e) { throw new RuntimeException(e); } } }
public void refresh() { URI location = md.getLocations()[0]; File f = new File(location); if (f.lastModified() > bundle.getLastModified()) { try { bundle.update(); registry.getPackageAdmin().refreshPackages(new Bundle[]{bundle}); } catch (BundleException e) { throw new RuntimeException(e); } } }