本文整理汇总了Java中com.rometools.rome.feed.synd.SyndFeed.createWireFeed方法的典型用法代码示例。如果您正苦于以下问题:Java SyndFeed.createWireFeed方法的具体用法?Java SyndFeed.createWireFeed怎么用?Java SyndFeed.createWireFeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rometools.rome.feed.synd.SyndFeed
的用法示例。
在下文中一共展示了SyndFeed.createWireFeed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = this.getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
assertTrue(sFeed1.equals(sFeed2));
}
示例2: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
PrintWriter w = new PrintWriter(new FileOutputStream("target/test-reports/1"));
w.println(sFeed1.toString());
w.close();
w = new PrintWriter(new FileOutputStream("target/test-reports/2"));
w.println(sFeed2.toString());
w.close();
assertEquals(sFeed1, sFeed2);
}
示例3: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
assertEquals(sFeed1, sFeed2);
}
示例4: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
PrintWriter w = new PrintWriter(new FileOutputStream("target/test-reports/1"));
w.println(sFeed1.toString());
w.close();
w = new PrintWriter(new FileOutputStream("target/test-reports/2"));
w.println(sFeed2.toString());
w.close();
assertEquals(sFeed2.createWireFeed(), sFeed1.createWireFeed());
}
示例5: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
PrintWriter w = new PrintWriter(new FileOutputStream("target/test-reports/3"));
w.println(sFeed1.toString());
w.close();
w = new PrintWriter(new FileOutputStream("target/test-reports/4"));
w.println(sFeed2.toString());
w.close();
assertEquals(sFeed1, sFeed2);
}
示例6: run
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
public void run()
{
// Not terribly efficient
AbstractRootSearchSection<?> rootSearch = info.lookupSection(AbstractRootSearchSection.class);
AbstractFreetextResultsSection<?, ?> searchResults = info
.lookupSection(AbstractFreetextResultsSection.class);
FreetextSearchEvent event = searchResults.createSearchEvent(info);
info.processEvent(event);
FreetextSearchResults<FreetextResult> results = freeTextService.search(event.getFinalSearch(), 0, length);
if( feedType.equals("rss_2.0") )
{
response.setContentType("application/rss+xml; charset=UTF-8");
}
else
{
response.setContentType("application/atom+xml; charset=UTF-8");
}
SyndFeed feed = getFeed(info, searchResults, results);
feed.setFeedType(feedType);
String title = rootSearch.getTitle(info).getText();
feed.setTitle(title);
String urlPath = path;
if( urlPath != null && urlPath.startsWith("/") )
{
urlPath = urlPath.substring(1);
}
feed.setLink(institutionService.institutionalise(urlPath));
feed.setDescription(title);
WireFeed wfeed = feed.createWireFeed(feedType);
if( wfeed instanceof Feed )
{
// add compulsory Atom fields
Feed atomFeed = (Feed) wfeed;
atomFeed.setId(institutionService.institutionalise("atom_1.0"));
atomFeed.setUpdated(new Date());
}
WireFeedOutput outputter = new WireFeedOutput();
try
{
outputter.output(wfeed, response.getWriter());
}
catch( Exception fe )
{
throw new RuntimeException(fe);
}
}