本文整理匯總了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();
}
示例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;
}
示例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;
}
示例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;
}
}