本文整理汇总了Java中com.rometools.rome.feed.synd.SyndFeed.getDescription方法的典型用法代码示例。如果您正苦于以下问题:Java SyndFeed.getDescription方法的具体用法?Java SyndFeed.getDescription怎么用?Java SyndFeed.getDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rometools.rome.feed.synd.SyndFeed
的用法示例。
在下文中一共展示了SyndFeed.getDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fetchSyndFeed
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private SyndFeed fetchSyndFeed(String url)
throws FeedException, IOException {
// fetch feed
SyndFeed f = getSyndFeed(getFeedInputStream(url));
if (f.getEntries().size() == 0)
throw new FeedException("Feed has no entries");
// clean title
String title =
StringUtils.isNullOrEmpty(f.getTitle()) ? null : f.getTitle();
if (title != null) title = clean(title, STRIP_ALL);
f.setTitle(title);
// clean description
String description =
StringUtils.isNullOrEmpty(f.getDescription()) ? null :
f.getDescription();
if (description != null) description = clean(description, STRIP_ALL);
f.setDescription(description);
// clean author
String author =
StringUtils.isNullOrEmpty(f.getAuthor()) ? null : f.getAuthor();
if (author != null) author = clean(author, STRIP_ALL);
f.setAuthor(author);
return f;
}
示例2: createFeed
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
public Feed createFeed(Feed feed, SyndFeed f, long lastEntryTime) {
long updated = clock.currentTimeMillis();
return new Feed(feed.getUrl(), feed.getBlog(), feed.getLocalAuthor(),
f.getDescription(), f.getAuthor(), feed.getAdded(), updated,
lastEntryTime);
}
示例3: testGenerate
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void testGenerate() throws Exception {
LOG.debug("testGenerate");
final SyndFeedInput input = new SyndFeedInput();
final SyndFeedOutput output = new SyndFeedOutput();
final File testDir = new File(super.getTestFile("xml"));
final File[] testFiles = testDir.listFiles();
for (int h = 0; h < testFiles.length; h++) {
if (!testFiles[h].getName().endsWith(".xml")) {
continue;
}
LOG.debug(testFiles[h].getName());
final SyndFeed feed = input.build(testFiles[h]);
// if( !feed.getFeedType().equals("rss_1.0"))
{
feed.setFeedType("rss_2.0");
if (feed.getDescription() == null) {
feed.setDescription("test file");
}
output.output(feed, new File("target/" + testFiles[h].getName()));
final SyndFeed feed2 = input.build(new File("target/" + testFiles[h].getName()));
for (int i = 0; i < feed.getEntries().size(); i++) {
// FIXME
// final SyndEntry entry = feed.getEntries().get(i);
final SyndEntry entry2 = feed2.getEntries().get(i);
// / FIXME
// final CreativeCommons base = (CreativeCommons)
// entry.getModule(CreativeCommons.URI);
final CreativeCommons base2 = (CreativeCommons) entry2.getModule(CreativeCommons.URI);
LOG.debug("{}", base2);
// FIXME
// if( base != null)
// this.assertEquals( testFiles[h].getName(), base.getLicenses(),
// base2.getLicenses() );
}
}
}
}