Search in sources :

Example 1 with ParsingFeedException

use of com.sun.syndication.io.ParsingFeedException in project xwiki-platform by xwiki.

the class RSSValidator method validate.

@Override
protected void validate(Document document) {
    try {
        SyndFeedInput input = new SyndFeedInput();
        input.build(getDocument());
    } catch (IllegalArgumentException e) {
        throw new RuntimeException(e);
    } catch (FeedException e) {
        if (e instanceof ParsingFeedException) {
            ParsingFeedException pfe = (ParsingFeedException) e;
            addError(Type.ERROR, pfe.getLineNumber(), pfe.getColumnNumber(), e.getMessage());
        } else {
            addError(Type.ERROR, -1, -1, e.getMessage());
        }
    }
}
Also used : ParsingFeedException(com.sun.syndication.io.ParsingFeedException) SyndFeedInput(com.sun.syndication.io.SyndFeedInput) FeedException(com.sun.syndication.io.FeedException) ParsingFeedException(com.sun.syndication.io.ParsingFeedException)

Aggregations

FeedException (com.sun.syndication.io.FeedException)1 ParsingFeedException (com.sun.syndication.io.ParsingFeedException)1 SyndFeedInput (com.sun.syndication.io.SyndFeedInput)1