Package com.sun.syndication.io

Examples of com.sun.syndication.io.SyndFeedOutput


      entries.add( entry );
    }//(end loop over entries)
   
    feed.setEntries( entries ); // you can add multiple entries in your feed
   
    SyndFeedOutput output = new SyndFeedOutput();
    String rss = null;
       
    try {
      rss = output.outputString(feed);   
    } catch (FeedException e) {
            e.printStackTrace(  );
            logger.error("Line: [" + e.getStackTrace()[2].getLineNumber() + "] " + e.getMessage());
        }
    return rss;       
View Full Code Here


        {
            File outputFile = new File(outputDirectory,
                                       String.format("mpo.%s.xml",
                                                     classifier));
            writer = new FileWriter(outputFile);
            SyndFeedOutput output = new SyndFeedOutput();
            output.output(feed,writer);
            writer.close();
        }
        catch (IOException e)
        {
            Logger.error(String.format("A problem occurred when generating the %s feed",
View Full Code Here

    tester.startResource(new RSSProducerResource());
    String responseTxt = tester.getLastResponse().getDocument();
    //write the RSS feed used in the test into a ByteArrayOutputStream
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    Writer writer = new OutputStreamWriter(outputStream);
    SyndFeedOutput output = new SyndFeedOutput();
        
    output.output(RSSProducerResource.getFeed(), writer);
    //the response and the written RSS must be equal
    Assert.assertEquals(responseTxt, outputStream.toString());
  }
View Full Code Here

      @Override
      public void writeData(Attributes attributes) throws IOException
      {
        OutputStream outputStream = attributes.getResponse().getOutputStream();
        Writer writer = new OutputStreamWriter(outputStream);
        SyndFeedOutput output = new SyndFeedOutput();
            try {
          output.output(getFeed(), writer);
        } catch (FeedException e) {
          throw new WicketRuntimeException("Problems writing feed to response...");
        }
      }     
    });
View Full Code Here

     */
    private static Feed atomFeed(SyndFeed syndFeed) {
        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

        // TODO: the null parameter below will break delegating parsers and generators
        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

            // Convert to an RSS feed
            if (feed != null) {
                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

        return "<![CDATA[" + value + "]]>";
    }

    protected void writeFeed(SyndFeed feed, MessageExchange messageExchange, NormalizedMessage message) throws IOException, FeedException {
        Writer writer = new FileWriter(feedFile);
        SyndFeedOutput output = new SyndFeedOutput();
        output.output(feed, writer);
        writer.close();
    }
View Full Code Here

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

            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

            // Convert to an RSS feed
            if (feed != null) {
                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

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.