@Override public int compare(Bundle b1, Bundle b2) { return (int) (b2.getLastModified() - b1.getLastModified()); } });
public long getLastModified() { Bundle current = systemBundle; if (current == null) return System.currentTimeMillis(); return current.getLastModified(); }
private BundleResources( Bundle bundle ) { this.bundle = bundle; this.bundleLastModified = bundle.getLastModified(); this.resourcesByLocale = new HashMap(); }
public long getLastModified() { Bundle current = systemBundle; if (current == null) return System.currentTimeMillis(); return current.getLastModified(); }
private BundleResources( Bundle bundle ) { this.bundle = bundle; this.bundleLastModified = bundle.getLastModified(); this.resourcesByLocale = new HashMap(); }
public static BundleDTO newBundleDTO(Bundle bundle) { if (bundle == null) { return null; } BundleDTO dto = new BundleDTO(); dto.id = bundle.getBundleId(); dto.lastModified = bundle.getLastModified(); dto.state = bundle.getState(); dto.symbolicName = bundle.getSymbolicName(); dto.version = bundle.getVersion().toString(); return dto; }
public long lastModified() throws IOException { URLConnection con = getURL().openConnection(); con.setUseCaches(false); long time = con.getLastModified(); // the implementation doesn't return the proper time stamp if (time == 0) { if (OsgiResourceUtils.PREFIX_TYPE_BUNDLE_JAR == searchType) return bundle.getLastModified(); } // there is nothing else we can do return time; }
public static BundleDTO newBundleDTO(Bundle bundle) { if (bundle == null) { return null; } BundleDTO dto = new BundleDTO(); dto.id = bundle.getBundleId(); dto.lastModified = bundle.getLastModified(); dto.state = bundle.getState(); dto.symbolicName = bundle.getSymbolicName(); dto.version = bundle.getVersion().toString(); return dto; }
public static BundleDTO newBundleDTO(Bundle bundle) { if (bundle == null) { return null; } BundleDTO dto = new BundleDTO(); dto.id = bundle.getBundleId(); dto.lastModified = bundle.getLastModified(); dto.state = bundle.getState(); dto.symbolicName = bundle.getSymbolicName(); dto.version = bundle.getVersion().toString(); return dto; }
private static BundleDTO createBundleDTO(Bundle bundle) { BundleDTO dto = new BundleDTO(); dto.id = bundle.getBundleId(); dto.lastModified = bundle.getLastModified(); dto.state = bundle.getState(); dto.symbolicName = bundle.getSymbolicName(); dto.version = "" + bundle.getVersion(); return dto; }
public static BundleDTO newBundleDTO(Bundle bundle) { if (bundle == null) { return null; } BundleDTO dto = new BundleDTO(); dto.id = bundle.getBundleId(); dto.lastModified = bundle.getLastModified(); dto.state = bundle.getState(); dto.symbolicName = bundle.getSymbolicName(); dto.version = bundle.getVersion().toString(); return dto; }
public static String createNamespaceFilter(BundleContext ctx) { Bundle bnd = getDMCoreBundle(ctx); if (bnd != null) { return "(|(" + DM_CORE_ID + "=" + bnd.getBundleId() + ")(" + DM_CORE_TS + "=" + bnd.getLastModified() + "))"; } return ""; } }
public static BundleDTO newBundleDTO(Bundle bundle) { if (bundle == null) { return null; } BundleDTO dto = new BundleDTO(); dto.id = bundle.getBundleId(); dto.lastModified = bundle.getLastModified(); dto.state = bundle.getState(); dto.symbolicName = bundle.getSymbolicName(); dto.version = bundle.getVersion().toString(); return dto; }
public long lastModified() throws IOException { URLConnection con = getURL().openConnection(); con.setUseCaches(false); long time = con.getLastModified(); // the implementation doesn't return the proper time stamp if (time == 0) { if (OsgiResourceUtils.PREFIX_TYPE_BUNDLE_JAR == searchType) return bundle.getLastModified(); } // there is nothing else we can do return time; }
public static String createNamespaceFilter(BundleContext ctx) { Bundle bnd = getDMCoreBundle(ctx); if (bnd != null) { return "(|(" + DM_CORE_ID + "=" + bnd.getBundleId() + ")(" + DM_CORE_TS + "=" + bnd.getLastModified() + "))"; } return ""; } }
public static BundleDTO newBundleDTO(Bundle bundle) { if (bundle == null) { return null; } BundleDTO dto = new BundleDTO(); dto.id = bundle.getBundleId(); dto.lastModified = bundle.getLastModified(); dto.state = bundle.getState(); dto.symbolicName = bundle.getSymbolicName(); dto.version = bundle.getVersion().toString(); return dto; }
public long getLastModified(String name) { ResourceBundle resource = getResourceInfo(name); if (resource == null) return -1; Bundle bundle = resource.getBundle(); if (bundle == null) return -1; return bundle.getLastModified(); }
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); } } }
protected void postInstall() throws Exception { Storage prefs = getStorage(); prefs.put(LAST_INSTALL, Long.toString(getBundle().getLastModified())); prefs.save(); }
@Override public String getModulesWebResourceCompleteKey() { return getStatefulKey(super.getModulesWebResourceCompleteKey(), getPluginBundle().getLastModified()); } }