fix opml import without head element (fix #737)

This commit is contained in:
Athou
2015-06-02 21:21:49 +02:00
parent 5ad57d1608
commit 18e70a0e6b

View File

@@ -1,9 +1,13 @@
package com.commafeed.backend.rome;
import java.util.Locale;
import org.jdom2.Document;
import org.jdom2.Element;
import com.rometools.opml.io.impl.OPML10Parser;
import com.rometools.rome.feed.WireFeed;
import com.rometools.rome.io.FeedException;
/**
* Support for OPML 1.1 parsing
@@ -26,4 +30,10 @@ public class OPML11Parser extends OPML10Parser {
return false;
};
@Override
public WireFeed parse(Document document, boolean validate, Locale locale) throws IllegalArgumentException, FeedException {
document.getRootElement().getChildren().add(new Element("head"));
return super.parse(document, validate, locale);
}
}