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


Java SyndFeed.getLinks方法代码示例

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


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

示例1: validateLink

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private void validateLink(final SyndFeed feed, final String source) {
    for (final SyndLink l : feed.getLinks()) {
        if ("self".equalsIgnoreCase(l.getRel())) {
            try {
                final URI u = new URI(l.getHref());
                final URI t = new URI(source);

                if (!u.equals(t)) {
                    throw new HttpStatusCodeException(400, "Feed self link does not match the subscribed URI.", null);
                }

                break;
            } catch (final URISyntaxException ex) {
                LOG.error(null, ex);
            }
        }
    }
}
 
开发者ID:rometools,项目名称:rome,代码行数:19,代码来源:Subscriptions.java

示例2: getNextPageUrl

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private String getNextPageUrl(Config config, SyndFeed page, String feedKey) {
    String result = "";

    if (null != page.getLinks() && CollectionUtils.isNotEmpty(page.getLinks())) {
        for (SyndLink link : page.getLinks()) {
            if (NEXT_ARCHIVE.equals(link.getRel())) {
                result = link.getHref();
                updateCurrentPageId(config, result, feedKey);
                break;
            }
        }
    }
    return result;
}
 
开发者ID:motech,项目名称:modules,代码行数:15,代码来源:OpenMRSAtomFeedServiceImpl.java

示例3: sendUpdateNotification

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
/**
 * Sends a notification for a feed located at "topic". The feed MUST contain rel="hub".
 *
 * @param topic URL for the feed
 * @param feed The feed itself
 * @throws NotificationException Any failure
 */
public void sendUpdateNotification(final String topic, final SyndFeed feed) throws NotificationException {
    for (final SyndLink link : feed.getLinks()) {
        if ("hub".equals(link.getRel())) {
            sendUpdateNotification(link.getRel(), topic);

            return;
        }
    }
    throw new NotificationException("Hub link not found.");
}
 
开发者ID:rometools,项目名称:rome,代码行数:18,代码来源:Publisher.java

示例4: findHubUrl

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private String findHubUrl(final SyndFeed feed) {
    for (final SyndLink l : feed.getLinks()) {
        if ("hub".equals(l.getRel())) {
            return l.getHref();
        }
    }

    return null;
}
 
开发者ID:rometools,项目名称:rome,代码行数:10,代码来源:Subscriptions.java

示例5: createRealFeed

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
protected WireFeed createRealFeed(final String type, final SyndFeed syndFeed) {
    final Channel channel = new Channel(type);
    channel.setModules(ModuleUtils.cloneModules(syndFeed.getModules()));
    channel.setStyleSheet(syndFeed.getStyleSheet());
    channel.setEncoding(syndFeed.getEncoding());

    channel.setTitle(syndFeed.getTitle());
    final String link = syndFeed.getLink();
    final List<SyndLink> links = syndFeed.getLinks();
    if (link != null) {
        channel.setLink(link);
    } else if (!links.isEmpty()) {
        channel.setLink(links.get(0).getHref());
    }

    channel.setDescription(syndFeed.getDescription());

    final SyndImage sImage = syndFeed.getImage();
    if (sImage != null) {
        channel.setImage(createRSSImage(sImage));
    }

    final List<SyndEntry> sEntries = syndFeed.getEntries();
    if (sEntries != null) {
        channel.setItems(createRSSItems(sEntries));
    }

    final List<Element> foreignMarkup = syndFeed.getForeignMarkup();
    if (!foreignMarkup.isEmpty()) {
        channel.setForeignMarkup(foreignMarkup);
    }

    return channel;
}
 
开发者ID:rometools,项目名称:rome,代码行数:35,代码来源:ConverterForRSS090.java

示例6: findHub

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private String findHub(SyndFeed feed) {
	for (SyndLink l : feed.getLinks()) {
		if ("hub".equalsIgnoreCase(l.getRel())) {
			log.debug("found hub {} for feed {}", l.getHref(), feed.getLink());
			return l.getHref();
		}
	}
	return null;
}
 
开发者ID:Athou,项目名称:commafeed,代码行数:10,代码来源:FeedParser.java

示例7: findSelf

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private String findSelf(SyndFeed feed) {
	for (SyndLink l : feed.getLinks()) {
		if ("self".equalsIgnoreCase(l.getRel())) {
			log.debug("found self {} for feed {}", l.getHref(), feed.getLink());
			return l.getHref();
		}
	}
	return null;
}
 
开发者ID:Athou,项目名称:commafeed,代码行数:10,代码来源:FeedParser.java


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