Package com.sun.syndication.io

Examples of com.sun.syndication.io.XmlReader


      httpSource.setConnectTimeout(Constants.HTTP_TIMEOUT);
      httpSource.setReadTimeout(Constants.HTTP_TIMEOUT);
      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);
View Full Code Here


   * @param includeReply if including reply
   * @return {@link PanelEntry} list
   */
  public List<PanelEntry> getPanelEntries(String feedURL, int maxSize, boolean includeReply) {
    SyndFeedInput input = new SyndFeedInput();
    XmlReader reader = null;
    HttpURLConnection feedConnection = null;
    try {
      List<PanelEntry> panelEntries = new ArrayList<PanelEntry>();
      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: ")) {
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

        try {
            logger.fine("invoke " + uri);

            // Read an RSS feed into a Synd feed
            SyndFeedInput input = new SyndFeedInput();
            SyndFeed feed = input.build(new XmlReader(new URL(uri)));
           
            //FIXME Support conversion to data-api entries
           
            msg.setBody(feed);
View Full Code Here

                feed = feedInput.build(new StringReader(src.toString()));

            }
            else if (src instanceof InputStream)
            {
                feed = feedInput.build(new XmlReader((InputStream) src));

            }
            else if (src instanceof byte[])
            {
                feed = feedInput.build(new XmlReader(new ByteArrayInputStream((byte[]) src)));

            }
            else if (src instanceof Document)
            {
                feed = feedInput.build((Document) src);
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

      Matcher hrefMatcher = linkHrefPattern.matcher(linkContent);
      if (hrefMatcher.find()) {
        String feedUrl = hrefMatcher.group(1);
        SyndFeedInput input = new SyndFeedInput();
        try {
          SyndFeed feed = input.build(new XmlReader(new URL(feedUrl)));
          List<String> contentList = getContent(feed.getEntries());
          result.addAll(contentList);
          return result;
        } catch (Exception e) {
          throw new RuntimeException("Could not get feed data from " + feedUrl, e);
View Full Code Here

            }

            for(String url : urls){
                URL feedSource = new URL(url);
                SyndFeedInput input = new SyndFeedInput();
                SyndFeed feed = input.build(new XmlReader(feedSource));
                feeds.add(feed);
            }

            manager.completeWorkItem(workItem.getId(), null);
        } catch (IOException ex) {
View Full Code Here

        {       
            try
            {
                URL feedUrl = new URL(url);
                SyndFeedInput input = new SyndFeedInput();
                SyndFeed feed = input.build(new XmlReader(feedUrl));
                SyndFeedOutput output = new SyndFeedOutput();           
                //output.output(feed, response.getWriter());
                Document document = output.outputW3CDom(feed);
   
                Map parameters = new HashMap();
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.