public void onEvent(RuntimeRecover event) { if (!repositoryIndex.exists()) { return; } try { mappings = parse(); List<URI> deleted = new ArrayList<>(); for (Map.Entry<URI, List<URI>> entry : mappings.entrySet()) { URI uri = entry.getKey(); Contribution contribution = store.find(uri); if (contribution == null) { deleted.add(uri); } else { contribution.addProfiles(entry.getValue()); } } for (URI uri : deleted) { mappings.remove(uri); } persist(); } catch (FileNotFoundException | InvalidRepositoryIndexException | XMLStreamException e) { monitor.error(e); } }
public void onEvent(RuntimeRecover event) { if (!repositoryIndex.exists()) { return; } try { mappings = parse(); List<URI> deleted = new ArrayList<URI>(); for (Map.Entry<URI, List<URI>> entry : mappings.entrySet()) { URI uri = entry.getKey(); Contribution contribution = store.find(uri); if (contribution == null) { deleted.add(uri); } else { contribution.addProfiles(entry.getValue()); } } for (URI uri : deleted) { mappings.remove(uri); } persist(); } catch (FileNotFoundException e) { monitor.error(e); } catch (XMLStreamException e) { monitor.error(e); } catch (InvalidRepositoryIndexException e) { monitor.error(e); } }