Package com.sun.syndication.io

Examples of com.sun.syndication.io.SyndFeedOutput


    }
    feed.setFeedType(feedTypes.get(feedType));
    createFeed(feed, model);
    response.setContentType(contentTypes.get(feedType));
    response.setCharacterEncoding("UTF-8");
    SyndFeedOutput output = new SyndFeedOutput();
    output.output(feed, response.getWriter());
  }
View Full Code Here


    Response response = getResponse();
   
    response.setContentType("application/rss+xml; charset=UTF-8");
   
    PrintWriter writer = new PrintWriter(response.getOutputStream());
    SyndFeedOutput output = new SyndFeedOutput();
    try
    {
      output.output(getFeed(), writer);
    }
    catch (IOException e)
    {
      throw new RuntimeException("Error streaming feed.", e);
    }
View Full Code Here

       * release of ROME"); entry.setDescription(description);
       */
      entries.add(entry);
    }
    feed.setEntries(entries);
    SyndFeedOutput out = new SyndFeedOutput();
    out.output(feed, new OutputStreamWriter(output));
  }
View Full Code Here

            else if ( ( groupId != null ) && ( artifactId != null ) )
            {
                feed.setLink( req.getRequestURL().toString() );               
            }

            SyndFeedOutput output = new SyndFeedOutput();
            output.output( feed, res.getWriter() );
        }
        catch ( ArchivaDatabaseException e )
        {
            log.debug( COULD_NOT_GENERATE_FEED_ERROR, e );
            res.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, COULD_NOT_GENERATE_FEED_ERROR );
View Full Code Here

        //feed.setEncoding();
        feed.setEntries( getEntries( releases ) );

        try
        {
            new SyndFeedOutput().output( feed, writer );
        }
        catch ( FeedException ex )
        {
            IOException ioex = new IOException( ex.getMessage() );
            ioex.initCause( ex );
View Full Code Here

        String output = null;
       
        try
        {
            //res.setContentType(MIME_TYPE);
            SyndFeedOutput out = new SyndFeedOutput();
            output = out.outputString(feed);
        }
        catch (FeedException fe)
        {
            String msg = COULD_NOT_GENERATE_FEED_ERROR;
            logger.error(msg, fe);
View Full Code Here

            log.error("Error:" + ex.toString());
        }

        log.debug(status);

        SyndFeedOutput output = new SyndFeedOutput();
        StringWriter writer = new StringWriter();

        try
        {
            output.output(feed, writer);
        }
        catch (IOException e)
        {
            log.error("error in writing feed");
        }
View Full Code Here

        try {
            URL ATOM_URL = new URL("http://soashable.blogspot.com/feeds/posts/default");
            //URL ATOM_URL = new URL("http://feeds.feedburner.com/HarlansDevelopmentJournal?format=xml");

            SyndFeedInput input = new SyndFeedInput();
            SyndFeedOutput output = new SyndFeedOutput();

            SyndFeed feed = input.build(new XmlReader(ATOM_URL));

            // crop it down to just 1 entry
            List entries = Arrays.asList(new Object[] { feed.getEntries().get(0) });
View Full Code Here

        ServletActionContext.getResponse().setCharacterEncoding(encoding);

      if (feedType != null)
        feed.setFeedType(feedType);

      SyndFeedOutput output = new SyndFeedOutput();

      Writer out = null;
      try {
        out = ServletActionContext.getResponse().getWriter();
        output.output(feed, out);
      } catch(Exception ex) {
        ex.printStackTrace();
      } finally {
        // close the output writer (will flush automatically)
        if (out != null)
View Full Code Here

      // Set the modification date
      response.setModificationDate(feed.getPublishedDate());

      // Write the feed back to the response

      SyndFeedOutput output = new SyndFeedOutput();
      Writer responseWriter = new OutputStreamWriter(response.getOutputStream(), characterEncoding);
      output.output(feed, responseWriter);
      response.getOutputStream().flush();
      return true;

    } catch (ContentRepositoryException e) {
      logger.error("Error loading articles for feeds from {}: {}", site.getIdentifier(), e.getMessage());
View Full Code Here

TOP

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

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.