Package com.rometools.rome.io

Examples of com.rometools.rome.io.WireFeedInput.build()


    MediaType contentType = inputMessage.getHeaders().getContentType();
    Charset charset =
        (contentType != null && contentType.getCharSet() != null? contentType.getCharSet() : DEFAULT_CHARSET);
    try {
      Reader reader = new InputStreamReader(inputMessage.getBody(), charset);
      return (T) feedInput.build(reader);
    }
    catch (FeedException ex) {
      throw new HttpMessageNotReadableException("Could not read WireFeed: " + ex.getMessage(), ex);
    }
  }
View Full Code Here


  public void importOpml(User user, String xml) {
    xml = xml.substring(xml.indexOf('<'));
    WireFeedInput input = new WireFeedInput();
    try {
      Opml feed = (Opml) input.build(new StringReader(xml));
      List<Outline> outlines = feed.getOutlines();
      for (Outline outline : outlines) {
        handleOutline(user, outline, null);
      }
    } catch (Exception e) {
View Full Code Here

        if (baseURI != null) {
            feedDoc.getRootElement().setAttribute("base", baseURI, Namespace.XML_NAMESPACE);
        }

        final WireFeedInput input = new WireFeedInput(false, locale);
        final Feed parsedFeed = (Feed) input.build(feedDoc);
        return parsedFeed.getEntries().get(0);
    }

}
View Full Code Here

        return saxBuilder.build(getFeedReader());
    }

    protected WireFeed getWireFeed() throws Exception {
        final WireFeedInput in = new WireFeedInput();
        return in.build(getFeedReader());
    }

    protected SyndFeed getSyndFeed(final boolean preserveWireFeed) throws Exception {
        final SyndFeedInput in = new SyndFeedInput();
        in.setPreserveWireFeed(preserveWireFeed);
View Full Code Here

        final WireFeedOutput output = new WireFeedOutput();
        output.output(feed, sw);
        sw.close();
        final StringReader reader = new StringReader(sw.toString());
        final WireFeedInput input = new WireFeedInput();
        feed = (Feed) input.build(reader);
        reader.close();
        assertEquals("<test>Hello Hello</test>", feed.getTitleEx().getValue().trim());
    }

    public void testXML() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.