Java Code Examples for com.rometools.rome.feed.atom.Entry#getModule()
The following examples show how to use
com.rometools.rome.feed.atom.Entry#getModule() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FileBasedCollection.java From rome with Apache License 2.0 | 6 votes |
private void updateFeedDocumentWithNewEntry(final Feed f, final Entry e) throws AtomException { boolean inserted = false; for (int i = 0; i < f.getEntries().size(); i++) { final Entry entry = f.getEntries().get(i); final AppModule mod = (AppModule) entry.getModule(AppModule.URI); final AppModule newMod = (AppModule) e.getModule(AppModule.URI); if (newMod.getEdited().before(mod.getEdited())) { f.getEntries().add(i, e); inserted = true; break; } } if (!inserted) { f.getEntries().add(0, e); } updateFeedDocument(f); }
Example 2
Source File: FileBasedCollection.java From rome with Apache License 2.0 | 6 votes |
private void updateFeedDocumentWithExistingEntry(final Feed f, final Entry e) throws AtomException { final Entry old = findEntry(e.getId(), f); f.getEntries().remove(old); boolean inserted = false; for (int i = 0; i < f.getEntries().size(); i++) { final Entry entry = f.getEntries().get(i); final AppModule entryAppModule = (AppModule) entry.getModule(AppModule.URI); final AppModule eAppModule = (AppModule) entry.getModule(AppModule.URI); if (eAppModule.getEdited().before(entryAppModule.getEdited())) { f.getEntries().add(i, e); inserted = true; break; } } if (!inserted) { f.getEntries().add(0, e); } updateFeedDocument(f); }
Example 3
Source File: FileBasedCollection.java From rome with Apache License 2.0 | 5 votes |
/** * Update existing or add new app:edited. */ private void updateTimestamps(final Entry entry) { // We're not differenting between an update and an edit (yet) entry.setUpdated(new Date()); AppModule appModule = (AppModule) entry.getModule(AppModule.URI); if (appModule == null) { appModule = new AppModuleImpl(); final List<Module> modules = entry.getModules() == null ? new ArrayList<Module>() : entry.getModules(); modules.add(appModule); entry.setModules(modules); } appModule.setEdited(entry.getUpdated()); }