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);
}
}
Aggregations