diff options
Diffstat (limited to 'document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java')
-rw-r--r-- | document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java b/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java index efbfd4a2167..7bc0cc871ca 100644 --- a/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java +++ b/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFeedReader.java @@ -28,13 +28,11 @@ import java.util.Optional; */ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader { - private final boolean requireVespaFeedTag; /** * Creates a reader that reads from the given file. */ public VespaXMLFeedReader(String fileName, DocumentTypeManager docTypeManager) throws Exception { super(fileName, docTypeManager); - requireVespaFeedTag = true; readInitial(); } @@ -42,18 +40,17 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader { * Creates a reader that reads from the given stream. */ public VespaXMLFeedReader(InputStream stream, DocumentTypeManager docTypeManager) throws Exception { - this(stream, docTypeManager, true); + super(stream, docTypeManager); + readInitial(); } /** - * Creates a reader that reads from the given stream. + * Creates a reader that uses the given reader to read - this can be used if the vespa feed + * is part of a larger XML document. */ - public VespaXMLFeedReader(InputStream stream, DocumentTypeManager docTypeManager, boolean requireVespaFeedTag) throws Exception { - super(stream, docTypeManager); - this.requireVespaFeedTag = requireVespaFeedTag; - if (requireVespaFeedTag) { - readInitial(); - } + public VespaXMLFeedReader(XMLStreamReader reader, DocumentTypeManager manager) throws Exception { + super(reader, manager); + readInitial(); } /** @@ -134,8 +131,6 @@ public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader { throw newDeserializeException("Missing \"documentid\" attribute for remove operation"); } return new RemoveFeedOperation(documentId, TestAndSetCondition.fromConditionString(condition)); - } else if ("vespafeed".equals(startTag)) { - //Ignore it } else { throw newDeserializeException("Element \"" + startTag + "\" not allowed in this context"); } |