Package com.sun.syndication.io

Examples of com.sun.syndication.io.SyndFeedOutput


    assertNotNull(syndFeed);
    assertEquals(1,syndFeed.getEntries().size());
 
    syndFeed.setFeedType("atom_1.0");
   
    SyndFeedOutput output = new SyndFeedOutput();
    String feedData = output.outputString(syndFeed);   
   
    StringReader sreader = new StringReader(feedData);
    SyndFeedInput input = new SyndFeedInput(true);
    SyndFeed copyFeed = input.build(sreader);
    assertNotNull(copyFeed);
View Full Code Here


                logger.debug("Found object on stack with expression '" + feedName + "': " + feed);

            if (feedType != null) // if the feedType is specified, we'll override the one set in the feed object
                feed.setFeedType(feedType);

            SyndFeedOutput output = new SyndFeedOutput();
            // 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

  public SyndFeedMediaResource(SyndFeed feed) {
    this.feed = feed;

    feedString = null;
    try {
      SyndFeedOutput output = new SyndFeedOutput();
      feedString = output.outputString(feed);
    } catch (FeedException e) {
      // cannot convert feed to string or something
    }
  }
View Full Code Here

        feed.setEntries(entries);
        return outputSyndFeed(feed);
    }

    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

        String feedType = RequestUtils.getStringParameter(request,FEED_TYPE);
        feedType = (feedType!=null) ? feedType : getDefaultFeedType();
        feed.setFeedType(feedType);
       
        response.setContentType(getContentType());
        SyndFeedOutput output = new SyndFeedOutput();
        output.output(feed,response.getWriter());
    }
View Full Code Here

     */
    public Document outputW3CDom() throws FeedException
    {
        try
        {
            SyndFeedOutput feedWriter = new SyndFeedOutput();
            return feedWriter.outputW3CDom(feed);
        }
        catch (FeedException e)
        {
            log.error(e);
            throw e;
View Full Code Here

    /**
     * @return the feed we built as serialized XML string
     */
    public String outputString() throws FeedException
    {
        SyndFeedOutput feedWriter = new SyndFeedOutput();
        return feedWriter.outputString(feed);
    }
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);
    }
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.