Package com.sun.syndication.feed

Examples of com.sun.syndication.feed.WireFeed


        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


     * After we parse the feed we put "rss_2.0" in it (so converters and generators work)
     * this parser is a phantom.
     *
     */
    protected WireFeed parseChannel(Element rssRoot) {
        WireFeed wFeed = super.parseChannel(rssRoot);
        wFeed.setFeedType("rss_2.0");

        return wFeed;
    }
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

          NodeList urlNodes = configDoc.getElementsByTagName("url");
          for (int i = 0; i < urlNodes.getLength(); i++) {
            // 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");
View Full Code Here

          NodeList urlNodes = configDoc.getElementsByTagName("url");
          for (int i = 0; i < urlNodes.getLength(); i++) {
            // 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");
View Full Code Here

        super(feedType+".xml");
    }

    //1.2a
    public void testWireFeedEquals() throws Exception {
        WireFeed feed1 = getCachedWireFeed();
        WireFeed feed2 = getWireFeed();
        assertTrue(feed1.equals(feed2));
    }
View Full Code Here

        assertTrue(feed1.equals(feed2));
    }

    //1.2b
    public void testWireFeedNotEqual() throws Exception {
        WireFeed feed1 = getCachedWireFeed();
        WireFeed feed2 = getWireFeed();
        feed2.setFeedType("dummy");
        assertFalse(feed1.equals(feed2));
    }
View Full Code Here

        assertFalse(feed1.equals(feed2));
    }

    //1.3
    public void testWireFeedCloning() throws Exception {
        WireFeed feed1 = getCachedWireFeed();
        WireFeed feed2 = (WireFeed) feed1.clone();;
        assertTrue(feed1.equals(feed2));
    }
View Full Code Here

        assertTrue(feed1.equals(feed2));
    }

    // 1.4
    public void testWireFeedSerialization() throws Exception {
        WireFeed feed1 = getCachedWireFeed();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(feed1);
        oos.close();

        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(bais);
        WireFeed feed2 = (WireFeed) ois.readObject();
        ois.close();

        assertTrue(feed1.equals(feed2));
    }
View Full Code Here

    }

    // 1.6
    public void testWireFeedSyndFeedConversion() throws Exception {
        SyndFeedI sFeed1 = getCachedSyndFeed();
        WireFeed wFeed1 = sFeed1.createWireFeed();
        SyndFeedI sFeed2 = new SyndFeed(wFeed1);

        assertTrue(sFeed1.equals(sFeed2));
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.WireFeed

Copyright © 2018 www.massapicom. 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.