當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。