Examples of SyndFeedOutput


Examples of com.sun.syndication.io.SyndFeedOutput

    // -------------------------------------------------------------------------

    protected void printFooter(PrintWriter writer, QueueBrowser browser, HttpServletRequest request) throws IOException, JMSException, ServletException {
        // now lets actually write out the content
        SyndFeed feed = getFeed(browser, request);
        SyndFeedOutput output = new SyndFeedOutput();
        try {
            output.output(feed, writer);
        } catch (FeedException e) {
            throw new ServletException(e);
        }
    }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

    protected void printFooter(PrintWriter writer, QueueBrowser browser, HttpServletRequest request)
            throws IOException, JMSException, ServletException {
        // now lets actually write out the content
        SyndFeed feed = getFeed(browser, request);
        SyndFeedOutput output = new SyndFeedOutput();
        try {
            output.output(feed, writer);
        }
        catch (FeedException e) {
            throw new ServletException(e);
        }
    }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

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

            SyndFeedOutput output = new SyndFeedOutput();
            output.output( feed, res.getWriter() );
        }
        catch ( UserNotFoundException unfe )
        {
            log.debug( COULD_NOT_AUTHENTICATE_USER, unfe );
            res.sendError( HttpServletResponse.SC_UNAUTHORIZED, COULD_NOT_AUTHENTICATE_USER );
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

//                                    + hit.getURL() + ". Cause: "
//                                    + e.getMessage(), e);
//                }
//            }
            feed.setEntries(entries);
            SyndFeedOutput output = new SyndFeedOutput();
            output.output(feed,writer);
            writer.close();
        }
        catch (Exception ex) {
            logger.error(ex.getMessage(), ex);
        }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

                entries.add(entry);

                feed.setEntries(entries);

                Writer writer = new FileWriter(fileName);
                SyndFeedOutput output = new SyndFeedOutput();
                output.output(feed,writer);
                writer.close();

                System.out.println("The feed has been written to the file ["+fileName+"]");

                ok = true;
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

        feed.setLink("http://place.holder.link");
        List entries = feed.getEntries();
        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

Examples of com.sun.syndication.io.SyndFeedOutput

     * @return E4X XML
     */
    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

Examples of com.sun.syndication.io.SyndFeedOutput

        try {
            if (arguments[0] instanceof String) {
                fileHostHostObject = (FileHostObject) cx.newObject(feedObject, "File", arguments);
                fileWriter = new FileWriter(fileHostHostObject.getFile());
                SyndFeedOutput output = new SyndFeedOutput();
                output.output(feedObject.feed, fileWriter);
                fileWriter.close();
            } else if (arguments[0] instanceof FileHostObject) {
                fileHostHostObject = (FileHostObject) arguments[0];
                fileWriter = new FileWriter(fileHostHostObject.getFile());
                SyndFeedOutput output = new SyndFeedOutput();
                output.output(feedObject.feed, fileWriter);
                fileWriter.flush();
            } else {
                throw new CarbonException("Invalid parameter");
            }
        } catch (FeedException e) {
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

    }

    @Override
    public void write(Writer writer) throws IOException {
        try {
            SyndFeedOutput output = new SyndFeedOutput();

            if (this.feed.getFeedType() == null) {
                this.feed.setFeedType("atom_1.0");
            }

            output.output(this.feed, writer);
        } catch (FeedException e) {
            IOException ioe = new IOException("Feed exception");
            ioe.initCause(e);
            throw ioe;
        }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

     */
    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
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.