Package com.sun.syndication.io

Examples of com.sun.syndication.io.SyndFeedOutput.output()


            // we'll need the writer since Rome doesn't support writing to an outputStream yet
            Writer out = null;
            try {
                out = ServletActionContext.getResponse().getWriter();
                preprocess(feed);
                output.output(feed, out);
                postprocess(feed);
            } catch (Exception e) {
                // Woops, couldn't write the feed ?
                logger.error("Could not write the feed: " + e.getMessage(), e);
            } finally {
View Full Code Here


        // Write feed to output
        response.setContentType(syndFeedType.contentType);
        response.setCharacterEncoding("UTF-8");
        SyndFeedOutput output = new SyndFeedOutput();
        try {
            output.output(syndFeed, response.getWriter());
        } catch (FeedException ex) {
            throw new ServletException(ex);
        }
        response.getWriter().flush();
View Full Code Here

      // TODO:GW Do we need this?
      // response.setContentLength(feed.get);

      writer = response.getWriter();
      SyndFeedOutput output = new SyndFeedOutput();
      output.output(feed, writer);

    } catch (FeedException e) {
      // throw olat exception for nice logging
      log.warn("Error when generating RSS stream for path::" + request.getPathInfo(), e);
      DispatcherAction.sendNotFound("none", response);
View Full Code Here

    }

    protected byte[] outputSyndFeed(SyndFeed feed) throws IOException, FeedException, UnsupportedEncodingException {
        SyndFeedOutput output = new SyndFeedOutput();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        output.output(feed, new OutputStreamWriter(baos, "utf-8"));
        baos.flush();
        baos.close();

        return baos.toByteArray();
    }
View Full Code Here

        feedType = (feedType!=null) ? feedType : getDefaultFeedType();
        feed.setFeedType(feedType);
       
        response.setContentType(getContentType());
        SyndFeedOutput output = new SyndFeedOutput();
        output.output(feed,response.getWriter());
    }
   
    /**
     * This method must be implemented by your subclass and must create a
     * <code>com.sun.syndication.feed.synd.SyndFeed</code>
 
View Full Code Here

     * send the output to designated Writer
     */
    public void output(java.io.Writer writer) throws FeedException, IOException
    {
        SyndFeedOutput feedWriter = new SyndFeedOutput();
        feedWriter.output(feed, writer);
    }

    // retrieve text for localization key (use freq to customize the message for
    // a specific resource type)
    private String localize(ResourceBundle labels, String s, int freq,
View Full Code Here

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
       
        syndFeed.setFeedType("atom_1.0");
        SyndFeedOutput syndOutput = new SyndFeedOutput();
        try {
            syndOutput.output(syndFeed, new OutputStreamWriter(bos));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        Parser parser = Abdera.getNewParser();
        Document<Feed> document = parser.parse(new ByteArrayInputStream(bos.toByteArray()));
View Full Code Here

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
       
        syndFeed.setFeedType("atom_1.0");
        SyndFeedOutput syndOutput = new SyndFeedOutput();
        try {
            syndOutput.output(syndFeed, new OutputStreamWriter(bos));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        Parser parser = Abdera.getNewParser();
        Document<Feed> document = parser.parse(new ByteArrayInputStream(bos.toByteArray()));
View Full Code Here

                    SyndFeed syndFeed = new SyndFeedImpl(feed);
                    syndFeed.setFeedType(requestFeedType);
                    syndFeed.setLink(path);
                    SyndFeedOutput syndOutput = new SyndFeedOutput();
                    try {
                        syndOutput.output(syndFeed, getWriter(response));
                    } catch (FeedException e) {
                        throw new ServletException(e);
                    }
                } else {
                    response.sendError(HttpServletResponse.SC_NOT_FOUND);
View Full Code Here

                response.setContentType("application/rss+xml; charset=utf-8");
                feed.setFeedType("rss_2.0");
                feed.setLink(path);
                SyndFeedOutput syndOutput = new SyndFeedOutput();
                try {
                    syndOutput.output(feed, getWriter(response));
                } catch (FeedException e) {
                    throw new ServletException(e);
                }
            } else {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
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.