Search in sources :

Example 6 with XmlReader

use of com.sun.syndication.io.XmlReader in project camel by apache.

the class RssUtils method createFeed.

public static SyndFeed createFeed(String feedUri, ClassLoader classLoader) throws Exception {
    ClassLoader tccl = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(classLoader);
        InputStream in = new URL(feedUri).openStream();
        SyndFeedInput input = new SyndFeedInput();
        return input.build(new XmlReader(in));
    } finally {
        Thread.currentThread().setContextClassLoader(tccl);
    }
}
Also used : InputStream(java.io.InputStream) SyndFeedInput(com.sun.syndication.io.SyndFeedInput) XmlReader(com.sun.syndication.io.XmlReader) URL(java.net.URL)

Aggregations

SyndFeedInput (com.sun.syndication.io.SyndFeedInput)6 XmlReader (com.sun.syndication.io.XmlReader)6 URL (java.net.URL)3 SyndFeed (com.sun.syndication.feed.synd.SyndFeed)2 InputStream (java.io.InputStream)2 URLConnection (java.net.URLConnection)2 GitBlitException (com.gitblit.GitBlitException)1 FeedEntryModel (com.gitblit.models.FeedEntryModel)1 SyndCategory (com.sun.syndication.feed.synd.SyndCategory)1 SyndEntry (com.sun.syndication.feed.synd.SyndEntry)1 SyndEntryImpl (com.sun.syndication.feed.synd.SyndEntryImpl)1 FeedException (com.sun.syndication.io.FeedException)1 File (java.io.File)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 IRISyntaxException (org.apache.abdera.i18n.iri.IRISyntaxException)1 ScriptException (org.jaggeryjs.scriptengine.exceptions.ScriptException)1