Package com.sun.syndication.io

Examples of com.sun.syndication.io.SyndFeedInput


        ModuleGenerators g =
                new ModuleGenerators( feed.getFeedType() + ITEM_MODULE_GENERATORS_POSFIX_KEY,
                        null);
        SyndFeedOutput o = new SyndFeedOutput();
        Document d = o.outputJDom( feed );
        SyndFeed feed2 = new SyndFeedInput().build( d );
        feed.copyFrom( feed2 );
    }
View Full Code Here


   */
  @SuppressWarnings("unchecked")
  public JSONObject process(String feedUrl, String feedXml,
      boolean getSummaries, int numEntries) throws GadgetException {
    try {
      SyndFeed feed = new SyndFeedInput().build(new StringReader(feedXml));
      JSONObject json = new JSONObject();
      json.put("Title", feed.getTitle());
      json.put("URL", feedUrl);
      json.put("Description", feed.getDescription());
      json.put("Link", feed.getLink());
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

    String encoding = detector.guessEncoding(content, defaultEncoding);
    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

    public Message invoke(Message msg) {
        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

    }

    @Override
    protected Object doTransform(Object src, String outputEncoding) throws TransformerException
    {
        SyndFeedInput feedInput = new SyndFeedInput();
        SyndFeed feed = null;
        try
        {
            if (src instanceof String)
            {
                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);

            }
            else if (src instanceof InputSource)
            {
                feed = feedInput.build((InputSource) src);

            }
            else if (src instanceof File)
            {
                feed = feedInput.build((File) src);

            }
            return feed;
        }
        catch (Exception e)
View Full Code Here

    if (matcher.find()) {
      String linkContent = matcher.group();
      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

   */
  @SuppressWarnings("unchecked")
  public JSONObject process(String feedUrl, String feedXml, boolean getSummaries, int numEntries)
          throws GadgetException {
    try {
      SyndFeed feed = new SyndFeedInput().build(new StringReader(feedXml));
      JSONObject json = new JSONObject();
      json.put("Title", feed.getTitle());
      json.put("URL", feedUrl);
      json.put("Description", feed.getDescription());
      json.put("Link", feed.getLink());
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

        else
        {       
            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.SyndFeedInput

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.