private static void removeOldArtifacts(List<URI> existingURIs) { for (IndexRow row : IndexUtil.INSTANCE.getIndex()) { URI rowURI = URI.createURI(row.getPhyURI()); if (rowURI != null && rowURI.isPlatformPlugin()) { if (!existingURIs.contains(rowURI)) { IndexUtil.INSTANCE.removeArtifact(rowURI); } } } }
/** * Runs the action. * * @param action the action proxy that handles the presentation portion of the action */ public void run(IAction action) { for (IndexRow row : IndexUtil.INSTANCE.getIndex()) { URI uri = ResourceUtil.uriFrom(row.getPhyURI()); IFile file = ResourceUtil.fileFor(uri); if (file == null || !file.exists()) { IndexUtil.INSTANCE.removeArtifact(row); } } IndexUtil.INSTANCE.commitIndex(); }