Skip to content
Snippets Groups Projects
Commit 324b15bb authored by srosse's avatar srosse
Browse files

OO-803: more exception catching for external blogs

parent 5cf3cd80
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.olat.admin.quota.QuotaConstants;
import org.olat.core.CoreSpringFactory;
import org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl;
......@@ -476,11 +477,17 @@ public class FeedManagerImpl extends FeedManager {
SyndFeed feed = null;
SyndFeedInput input = new SyndFeedInput();
String feedURL = extFeed.getExternalFeedUrl();
XmlReader reader = null;
try {
URL url = new URL(feedURL);
feed = input.build(new XmlReader(url));
reader = new XmlReader(url);
feed = input.build(reader);
// also add the external image url just in case we'll need it later
addExternalImageURL(feed, extFeed);
} catch(IllegalArgumentException e) {
log.warn("The external feed is invalid: " + feedURL, e);
IOUtils.closeQuietly(reader);
} catch (MalformedURLException e) {
log.info("The externalFeedUrl is invalid: " + feedURL);
} catch (FeedException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment