Search in sources :

Example 6 with SyndFeedOutput

use of com.sun.syndication.io.SyndFeedOutput in project opennms by OpenNMS.

the class AbstractFeed method render.

/**
     * <p>render</p>
     *
     * @return a {@link java.lang.String} object.
     */
@Override
public final String render() {
    SyndFeed feed = this.getFeed();
    feed.setFeedType(this.getFeedType());
    feed.setAuthor("OpenNMS");
    SyndFeedOutput output = new SyndFeedOutput();
    try {
        StringWriter writer = new StringWriter();
        output.output(feed, writer);
        return writer.toString();
    } catch (Throwable e) {
        LOG.warn("unable to render feed", e);
        return "";
    }
}
Also used : SyndFeed(com.sun.syndication.feed.synd.SyndFeed) StringWriter(java.io.StringWriter) SyndFeedOutput(com.sun.syndication.io.SyndFeedOutput)

Aggregations

SyndFeedOutput (com.sun.syndication.io.SyndFeedOutput)6 SyndFeed (com.sun.syndication.feed.synd.SyndFeed)4 SyndEntry (com.sun.syndication.feed.synd.SyndEntry)3 SyndFeedImpl (com.sun.syndication.feed.synd.SyndFeedImpl)3 FeedException (com.sun.syndication.io.FeedException)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 SyndContent (com.sun.syndication.feed.synd.SyndContent)2 SyndContentImpl (com.sun.syndication.feed.synd.SyndContentImpl)2 SyndEntryImpl (com.sun.syndication.feed.synd.SyndEntryImpl)2 OutputStreamWriter (java.io.OutputStreamWriter)2 Date (java.util.Date)2 FeedEntryModel (com.gitblit.models.FeedEntryModel)1 SyndCategory (com.sun.syndication.feed.synd.SyndCategory)1 SyndCategoryImpl (com.sun.syndication.feed.synd.SyndCategoryImpl)1 SyndImageImpl (com.sun.syndication.feed.synd.SyndImageImpl)1 File (java.io.File)1 FileWriter (java.io.FileWriter)1 StringWriter (java.io.StringWriter)1 Writer (java.io.Writer)1