Package com.sun.syndication.io

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


    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


    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

     * @return the feed we built as serialized XML string
     */
    public String outputString() throws FeedException
    {
        SyndFeedOutput feedWriter = new SyndFeedOutput();
        return feedWriter.outputString(feed);
    }

    /**
     * send the output to designated Writer
     */
 
View Full Code Here

        entries.add(entry);
        feed.setEntries(entries);

        SyndFeedOutput output = new SyndFeedOutput();
        try {
            String xmlRep = output.outputString(feed);


            if (this.getType().contains("rss")) {
                int start = xmlRep.indexOf("<item>") + "</item>".length();
                int end = xmlRep.indexOf("</item>");
View Full Code Here

    public Scriptable jsGet_XML() throws CarbonException {
        Context cx = Context.getCurrentContext();
        if (feed != null) {
            SyndFeedOutput output = new SyndFeedOutput();
            try {
                String xmlRep = output.outputString(feed);
                //removing the encoding part, since it makes trouble sometimes
                xmlRep = xmlRep.substring(xmlRep.indexOf("?>") + 2);
                Object[] objects = { xmlRep };
                return cx.newObject(this, "XML", objects);
            } catch (FeedException e) {
View Full Code Here

    }
   
    @Converter
    public static String feedToXml(SyndFeed feed) throws FeedException {
        SyndFeedOutput out = new SyndFeedOutput();
        return out.outputString(feed);
    }  
   
    @Converter
    public static SyndFeed xmlToFeed(String xml) throws FeedException {
        SyndFeedInput input = new SyndFeedInput();
View Full Code Here

   */
  @GET
  @Produces(MediaType.APPLICATION_XML)
  public String getFeedbackFeed() throws FeedException {   
        SyndFeedOutput output = new SyndFeedOutput();
        return output.outputString(logEntriesRssFeed);       
  }
 
  /**
   * Read existing feedback log file, if it exists, turning
   * into a series of log entries submitted. Use these to instantiate
View Full Code Here

     */
    public String outputString()
        throws FeedException
    {
        SyndFeedOutput feedWriter = new SyndFeedOutput();
        return feedWriter.outputString(feed);
    }

    /**
     * send the output to designated Writer
     */
 
View Full Code Here

   
    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

     */
    public String outputString()
        throws FeedException
    {
        SyndFeedOutput feedWriter = new SyndFeedOutput();
        return feedWriter.outputString(feed);
    }

    /**
     * send the output to designated Writer
     */
 
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.