Package com.sun.syndication.io

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


        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

    try {
      InputSource input = new InputSource(new ByteArrayInputStream(content
          .getContent()));
      input.setEncoding(encoding);
      SyndFeedInput feedInput = new SyndFeedInput();
      feed = feedInput.build(input);
    } catch (Exception e) {
      // return empty parse
      LOG.warn("Parse failed: url: " + content.getUrl() + ", exception: "
          + StringUtils.stringifyException(e));
      return new ParseStatus(e)
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

                    .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) {
View Full Code Here

      httpSource.addRequestProperty("User-Agent", Constants.HTTP_USERAGENT);
     
      SyndFeedInput input = new SyndFeedInput();
      XmlReader reader = new XmlReader(httpSource);

      this.feed = input.build(reader);
      this.size = feed.getEntries().size();
      setLoaded(true);

    } catch (MalformedURLException e) {
      StoryReaderException sre=new StoryReaderException(Constants.EXCEPTION_INVALID_URL + ": "+ e.getMessage());
View Full Code Here

      URL url = new URL(feedURL);
      feedConnection = (HttpURLConnection) url.openConnection();
      feedConnection.setConnectTimeout(4000);
      feedConnection.setReadTimeout(4000);
      reader = new XmlReader(feedConnection);
      SyndFeed feed = input.build(reader);
      int count = 0;
      for (Object eachObj : feed.getEntries()) {
        SyndEntryImpl each = cast(eachObj);
        if (!includeReply && StringUtils.startsWithIgnoreCase(each.getTitle(), "Re: ")) {
          continue;
View Full Code Here

    try {
      InputSource input = new InputSource(new ByteArrayInputStream(content
          .getContent()));
      input.setEncoding(encoding);
      SyndFeedInput feedInput = new SyndFeedInput();
      feed = feedInput.build(input);
    } catch (Exception e) {
      // return empty parse
      LOG.warn("Parse failed: url: " + content.getUrl() + ", exception: "
          + StringUtils.stringifyException(e));
      return new ParseStatus(e)
View Full Code Here

        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

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.