当前位置: 首页>>代码示例>>Java>>正文


Java SyndFeed.createWireFeed方法代码示例

本文整理汇总了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));
}
 
开发者ID:rometools,项目名称:rome,代码行数:8,代码来源:FeedOpsTest.java

示例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);
}
 
开发者ID:rometools,项目名称:rome,代码行数:15,代码来源:TestOpsOPML10.java

示例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);
}
 
开发者ID:rometools,项目名称:rome,代码行数:8,代码来源:FeedOpsTest.java

示例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());
}
 
开发者ID:rometools,项目名称:rome,代码行数:15,代码来源:TestOpsOPML10links.java

示例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);
}
 
开发者ID:rometools,项目名称:rome,代码行数:14,代码来源:TestOpsOPML20.java

示例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);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:52,代码来源:FeedServlet.java


注:本文中的com.rometools.rome.feed.synd.SyndFeed.createWireFeed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。