本文整理汇总了Java中org.apache.abdera.model.Feed.getEntries方法的典型用法代码示例。如果您正苦于以下问题:Java Feed.getEntries方法的具体用法?Java Feed.getEntries怎么用?Java Feed.getEntries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.abdera.model.Feed
的用法示例。
在下文中一共展示了Feed.getEntries方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDocument
import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
private Document<Feed> getDocument() throws IOException, ParseException {
if (document == null) {
if (ObjectHelper.isEmpty(endpoint.getUsername()) || ObjectHelper.isEmpty(endpoint.getPassword())) {
document = AtomUtils.parseDocument(endpoint.getFeedUri());
} else {
document = AtomUtils.parseDocument(endpoint.getFeedUri(), endpoint.getUsername(), endpoint.getPassword());
}
Feed root = document.getRoot();
if (endpoint.isSortEntries()) {
sortEntries(root);
}
list = root.getEntries();
entryIndex = list.size() - 1;
}
return document;
}
示例2: the_feed_exposes_the_publicid
import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@Test
public void the_feed_exposes_the_publicid() {
Guest guest = new Guest("123", "foo", "[email protected]");
guest.setLastUpdate(now());
when(abdera.newFeed()).thenReturn(new FOMFeed());
when(uriInfo.getBaseUri()).thenReturn(create("http://localhost/"));
when(guestService.getAllGuests()).thenReturn(singletonList(guest));
GuestAtomFeed guestAtomFeed = new GuestAtomFeed(guestService, abdera);
Feed guestFeed = guestAtomFeed.getGuestFeed(uriInfo);
List<Entry> entries = guestFeed.getEntries();
assertThat(entries).isNotEmpty();
Entry entry = entries.get(0);
assertThat(entry.getLinks().get(0).getHref().toASCIIString()).endsWith("/guests/123");
}
示例3: getPropertyMapForFeed
import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
public List<Map<String, Object>> getPropertyMapForFeed(Feed feed)
throws FeedServerAdapterException {
List<Entry> entries = feed.getEntries();
List<Map<String, Object>> propertiesList = new ArrayList<Map<String, Object>>(entries.size());
for (Entry entry : entries) {
propertiesList.add(getPropertyMapForEntry(entry));
}
return propertiesList;
}
示例4: getMessagesAtom
import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
private List<FeedMessageContainer> getMessagesAtom() {
List<FeedMessageContainer> messages = new ArrayList<>();
Parser parser = abdera.getParser();
Document<Feed> doc = null;
try {
doc = parser.parse(url.openStream(),url.toString());
} catch (IOException exception) {
exception.printStackTrace();
}
Feed feed = doc.getRoot();
for (Entry entry : feed.getEntries()) {
messages.add(new FeedMessageContainer(entry));
}
return messages;
}
示例5: from
import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
public static String from(Reader reader, ProgressDialogJFrame progressDialogJFrame) {
try {
Abdera abdera = new Abdera();
Parser parser = abdera.getParser();
Document<Feed> doc = parser.parse(reader);
Feed feed = doc.getRoot();
HashMap<String, Entry> entryByUri=new HashMap<String, Entry>();
logger.debug(feed.getTitle());
for (Entry entry : feed.getEntries()) {
logger.debug("\t"+entry.getTitle());
entryByUri.put(entry.getId().toString(), entry);
}
String outlineUri = null;
String outlineLabel;
String labelUri = MindRaider.labelCustodian.LABEL_TWIKI_IMPORT_URI;
MindRaider.labelCustodian.create("Atom Import", MindRaider.labelCustodian.LABEL_ATOM_IMPORT_URI);
outlineLabel = feed.getTitle()+" ("+Utils.getCurrentDataTimeAsPrettyString()+")";
logger.debug("Outline label: '"+outlineLabel+"'");
outlineUri = MindRaiderVocabulary.getNotebookUri(Utils.toNcName(outlineLabel));
String createdUri;
while (MindRaiderConstants.EXISTS.equals(createdUri = MindRaider.outlineCustodian.create(
outlineLabel,
outlineUri,
feed.getSubtitle(),
false))) {
outlineUri += "_";
}
outlineUri = createdUri;
MindRaider.labelCustodian.addOutline(labelUri, outlineUri);
OutlineResource activeOutlineResource = MindRaider.outlineCustodian.getActiveOutlineResource();
// fill in notebook resource
activeOutlineResource.save();
logger.debug("Outline created: " + outlineUri);
String parentNoteUri=activeOutlineResource.getUri();
List<Link> childrenLinks = feed.getLinks(Atomizer.ATOM_REL_CHILD_NOTE);
fromOneLevel(progressDialogJFrame, entryByUri, outlineUri, parentNoteUri, childrenLinks, activeOutlineResource);
return outlineUri;
} catch(Exception e) {
logger.debug("Unable to import Outline from Atom",e);
return null;
} finally {
// now refresh notebook outline
ExplorerJPanel.getInstance().refresh();
OutlineJPanel.getInstance().refresh();
MindRaider.spidersGraph.renderModel();
}
}