Package com.sun.syndication.io

Examples of com.sun.syndication.io.WireFeedInput.build()


        setBaseURI(baseURI);

        WireFeedInput input = new WireFeedInput();
        try {
            WireFeed feed = input.build(reader);
            if(feed instanceof Channel) {
                parseFeed((Channel) feed);
            } else {
                throw new RDFParseException("data stream is not an RSS feed");
            }
View Full Code Here


        if (baseURI != null) {
            feedDoc.getRootElement().setAttribute("base", baseURI, Namespace.XML_NAMESPACE);
        }
       
        WireFeedInput input = new WireFeedInput();
        Feed parsedFeed = (Feed)input.build(feedDoc);
        return (Entry)parsedFeed.getEntries().get(0);
    }
}

View Full Code Here

        WireFeedOutput wireFeedOutput = new WireFeedOutput();
        Document feedDoc = wireFeedOutput.outputJDom(feed);
        feedDoc.getRootElement().addContent(fetchedEntryElement);
               
        WireFeedInput input = new WireFeedInput();
        Feed parsedFeed = (Feed)input.build(feedDoc);
        return (Entry)parsedFeed.getEntries().get(0);
    }
   
     /**
     * Serialize an entry to an OutputStream.
View Full Code Here

            MediaType mediaType,
            MultivaluedMap<String, String> httpHeaders,
            InputStream entityStream) throws IOException {
        try {
            WireFeedInput input = new WireFeedInput();                     
            WireFeed wireFeed = input.build(new InputStreamReader(entityStream));   
            if (!(wireFeed instanceof Feed)) {
                throw new IOException(ImplMessages.ERROR_NOT_ATOM_FEED(type));
            }
            return (Feed)wireFeed;
        } catch (FeedException cause) {
View Full Code Here

            // read in georss and build tree
            String georssUrlStr = urlNodes.item(i).getFirstChild()
                .getNodeValue();
            WireFeed feed = null;
            try {
              feed = wf.build(new XmlReader(new URL(georssUrlStr)));
            } catch (Exception e) {
              System.out.println("[ERROR] Error obtaining geodata url: ["
                  + georssUrlStr + "]: Message: "+e.getMessage()+": skipping and continuing");
              continue;
            }
View Full Code Here

            // read in georss and build tree
            String georssUrlStr = urlNodes.item(i).getFirstChild()
                .getNodeValue();
            WireFeed feed = null;
            try {
              feed = wf.build(new XmlReader(new URL(georssUrlStr)));
            } catch (Exception e) {
              System.out.println("[ERROR] Error obtaining geodata url: ["
                  + georssUrlStr + "]: Message: "+e.getMessage()+": skipping and continuing");
              continue;
            }
View Full Code Here

    } else {
      charset = 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

        if (rollerElement == null) {
            mLogger.debug("Client is NOT preserving foreign markup");
        }
       
        WireFeedInput input = new WireFeedInput();
        Feed parsedFeed = (Feed)input.build(feedDoc);
        return (Entry)parsedFeed.getEntries().get(0);
    }
}
View Full Code Here

        return saxBuilder.build(getFeedReader());
    }

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

    protected SyndFeedI getSyndFeed() throws Exception {
        SyndFeedInput in = new SyndFeedInput();
        return in.build(getFeedReader());
View Full Code Here

    }

    public void testRead() throws Exception {
        Reader r = new StringReader(createFeed());
        WireFeedInput input = new WireFeedInput();
        Channel ch = (Channel) input.build(r);
    }

    public void testReadWrite() throws Exception {
        Reader r = new StringReader(createFeed());
        WireFeedInput input = new WireFeedInput();
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.