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


Java SyndFeed.getUri方法代码示例

本文整理汇总了Java中com.sun.syndication.feed.synd.SyndFeed.getUri方法的典型用法代码示例。如果您正苦于以下问题:Java SyndFeed.getUri方法的具体用法?Java SyndFeed.getUri怎么用?Java SyndFeed.getUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.syndication.feed.synd.SyndFeed的用法示例。


在下文中一共展示了SyndFeed.getUri方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SyndEntryAdapter

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public SyndEntryAdapter(SyndFeed feed, SyndEntry entry) {
    if (entry.getTitleEx() != null) {
        this.title = entry.getTitle();
        this.titleType = entry.getTitleEx().getType();
    }
    if (entry.getDescription() != null) {
        this.description = entry.getDescription().getValue();
        this.descriptionType = entry.getDescription().getType();
    }
    this.uri = entry.getUri();
    this.author = entry.getAuthor();
    this.link = entry.getLink();

    if (entry.getPublishedDate() != null)
        this.publishedDate = ISO_8601_DATE_FORMAT.format(entry.getPublishedDate());
    if (entry.getUpdatedDate() != null)
        this.updatedDate = ISO_8601_DATE_FORMAT.format(entry.getUpdatedDate());
    this.fetchDate = ISO_8601_DATE_FORMAT.format(new Date());

    this.sourceLink = feed.getLink();
    this.sourceUri = feed.getUri();
    this.sourceTitle = feed.getTitle();
    this.language = feed.getLanguage();
    this.sourceType = feed.getFeedType();
}
 
开发者ID:marozau,项目名称:expresso,代码行数:26,代码来源:SyndEntryAdapter.java

示例2: createRealFeed

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
    Channel channel = (Channel) super.createRealFeed(type,syndFeed);        
    if (syndFeed.getUri() != null) {
    	channel.setUri(syndFeed.getUri());
    } else {
    	// if URI is not set use the value for link
    	channel.setUri(syndFeed.getLink());
    }
    
    return channel;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:ConverterForRSS10.java

示例3: createRealFeed

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
    Channel channel = (Channel) super.createRealFeed(type,syndFeed);        
    if (syndFeed.getUri() != null) {
    	channel.setUri(syndFeed.getUri());
    } else {
    	// if URI is not set use the value for link
    	channel.setUri(syndFeed.getLink());
    }
    
    return channel;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:13,代码来源:ConverterForRSS10.java

示例4: doPost

import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    String hubtopic = null;
    String hubchallenge = null;
    MessageStatus stsMessage = MessageStatus.ERROR;

    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(SyndFeedInput.class.getClassLoader());

    if (request.getContentType().contains(MediaType.APPLICATION_ATOM_XML)
            || request.getContentType().contains(MediaType.APPLICATION_RSS_XML)) {

        InputStream in = request.getInputStream();

        try {
            SyndFeedInput input = new SyndFeedInput();
            SyndFeed feed = input.build(new XmlReader(in));

            List<SyndLinkImpl> linkList = feed.getLinks();

            for (SyndLinkImpl link : linkList) {

                if ("self".equals(link.getRel())) {
                    hubtopic = link.getHref();
                }
            }

            if (hubtopic == null) {
                hubtopic = feed.getUri();
            }

            topicUpdated(hubtopic, feed);
        } catch (FeedException e) {
            LOG.error("Failed in creating feed response.", e);
        } finally {
            Thread.currentThread().setContextClassLoader(cl);
        }


        stsMessage = MessageStatus.OK;
    }

    response.setContentType(MediaType.APPLICATION_FORM_URLENCODED);

    switch (stsMessage) {
        case OK:
            response.setStatus(HttpStatus.SC_OK);
            break;
        case OK_CHALLENGE:
            response.setStatus(HttpStatus.SC_OK);
            response.getWriter().print(hubchallenge);
            break;
        default:
            response.setStatus(HttpStatus.SC_NOT_FOUND);
            break;
    }

}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:60,代码来源:CallbackServlet.java


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