Package com.sun.syndication.io

Examples of com.sun.syndication.io.XmlReader


     * @throws FeedException RSSフィードのパースに失敗した場合。
     */
    public SyndFeed getFeed() throws FeedException, IOException {
        URL feedUrl = new URL(FEED_URL);
        SyndFeedInput input = new SyndFeedInput();
        return input.build(new XmlReader(feedUrl.openStream()));
    }
View Full Code Here


    for (Iterator itr = feeds.iterator(); itr.hasNext(); ) {
      String feed = (String)itr.next();
      try {
        URL feedUrl = new URL(feed);
        SyndFeedInput input = new SyndFeedInput();
        SyndFeed sf = input.build(new XmlReader(feedUrl));
        List docs = readDocumentsFromFeed(sf, docFactory);
        int size = docs.size();
        log.info("Read " + size + " documents from feed: " + feed);
        count += size;
      } catch (MalformedURLException e) {
View Full Code Here

    return entries.get(0);
  }

  private SyndFeed getFeed() throws FeedException, IOException {
    SyndFeedInput input = new SyndFeedInput();
    SyndFeed feed = input.build(new XmlReader(this.rssUrl));

    return feed;
  }
View Full Code Here

                    .getClassLoader());
            c = getGmailConnection();
            c.setUrl(gmailFeedUrl);
            final URLConnection con = c.openConnection();
            final SyndFeedInput feedInput = new SyndFeedInput();
            final SyndFeed gmail = feedInput.build(new XmlReader(con));
            for (final Object entry : gmail.getEntries()) {
                if (entry instanceof SyndEntry) {
                    messages.add(new RssGmailMessage((SyndEntry) entry));
                }
            }
View Full Code Here

    protected SyndFeed loadOrCreateFeed() throws IllegalArgumentException, FeedException, IOException {
        if (isLoadOnStartup()) {
            File file = getFeedFile();
            if (file.exists() && file.isFile()) {
                SyndFeedInput input = new SyndFeedInput();
                XmlReader xmlReader = new XmlReader(file);
                return input.build(xmlReader);
            }
        }
        return createFeed();
    }
View Full Code Here

        SyndFeedInput input = new SyndFeedInput();
        for (int i = 0;i < urls.size();i++) {
            URL inputUrl = (URL) urls.get(i);
            SyndFeed inFeed;
            try {
                inFeed = input.build(new XmlReader(inputUrl));
                List entries = inFeed.getEntries();
                for (int k = 0;k < entries.size();k++) {
                    SyndEntry entry = (SyndEntry) entries.get(k);
                    if (entry.getPublishedDate().after(getLastPolledDate())) {
                        result.add(entry);
View Full Code Here

  @SuppressWarnings("unchecked")
  public void parse() throws Exception {
    SyndFeedInput input = new SyndFeedInput();
    byte b[] = downloadAndSendBinary(url);
    if (b != null) {
      SyndFeed feed = input.build(new XmlReader(new ByteArrayInputStream(b)));
      name = feed.getTitle();
      if (feed.getCategories() != null && feed.getCategories().size() > 0) {
        SyndCategory category = (SyndCategory) feed.getCategories().get(0);
        tempCategory = category.getName();
      }
View Full Code Here

    final Response response =
        RequestFacade.sendMessage(FEED_URL_PART + feedId + sb.toString(), Method.GET);
    final String text = response.getEntity().getText();
    Assert.assertTrue("Unexpected response: " + text, response.getStatus().isSuccess());

    return new SyndFeedInput().build(new XmlReader(new ByteArrayInputStream(text.getBytes())));
  }
View Full Code Here

                    .getClassLoader());
            c = getGmailConnection();
            c.setUrl(gmailFeedUrl);
            final URLConnection con = c.openConnection();
            final SyndFeedInput feedInput = new SyndFeedInput();
            final SyndFeed gmail = feedInput.build(new XmlReader(con));
            for (final Object entry : gmail.getEntries()) {
                if (entry instanceof SyndEntry) {
                    messages.add(new RssGmailMessage((SyndEntry) entry));
                }
            }
View Full Code Here

    public Feed getFeed(URL url) throws FeedException, IOException {
        Feed f = null;
        final SyndFeedInput input = new SyndFeedInput();
        try {
            final SyndFeed romeFeed = input.build(
                    new XmlReader(HttpUtil.getConnectionStream(url, options)));
            f = new Feed();
            f.setTitle(romeFeed.getTitle());
            String link = romeFeed.getLink();
            if (link != null) {
                f.setUrl(new URL(link));
View Full Code Here

TOP

Related Classes of com.sun.syndication.io.XmlReader

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.