Package org.jivesoftware.util

Examples of org.jivesoftware.util.XMLWriter


                file.delete();
            }
            // Create new version.xml with returned data
            writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
            OutputFormat prettyPrinter = OutputFormat.createPrettyPrint();
            XMLWriter xmlWriter = new XMLWriter(writer, prettyPrinter);
            xmlWriter.write(xmlResponse);
        }
        catch (Exception e) {
            Log.error(e.getMessage(), e);
        }
        finally {
View Full Code Here


                file.delete();
            }
            // Create new version.xml with returned data
            writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
            OutputFormat prettyPrinter = OutputFormat.createPrettyPrint();
            XMLWriter xmlWriter = new XMLWriter(writer, prettyPrinter);
            xmlWriter.write(xml);
        }
        catch (Exception e) {
            Log.error(e.getMessage(), e);
        }
        finally {
View Full Code Here

        }
        // Generate content to store in property
        String vcardXML;
        StringWriter writer = new StringWriter();
        OutputFormat prettyPrinter = OutputFormat.createPrettyPrint();
        XMLWriter xmlWriter = new XMLWriter(writer, prettyPrinter);
        try {
            xmlWriter.write(vCard);
            vcardXML = writer.toString();
        }
        catch (IOException e) {
            Log.error("Error pretty formating XML", e);
            vcardXML = vCard.asXML();
View Full Code Here

            ByteBuffer buffer = ByteBuffer.allocate(4096);
            buffer.setAutoExpand(true);

            boolean errorDelivering = false;
            try {
                XMLWriter xmlSerializer =
                        new XMLWriter(new ByteBufferWriter(buffer, encoder.get()), new OutputFormat());
                xmlSerializer.write(packet.getElement());
                xmlSerializer.flush();
                if (flashClient) {
                    buffer.put((byte) '\0');
                }
                buffer.flip();
                ioSession.write(buffer);
View Full Code Here

            /**
             * 这里重写了sun中IO类的writer方法,将其中实现改为MINA提供的方法,用于XMLWriter
             * XMLWriter把packet中的xml文件转换成一个流,写进IoBuffer在通过session向client端发送
             *
             */
        XMLWriter xmlSerializer = new XMLWriter(new IoBufferWriter(
            buffer, (CharsetEncoder) encoder.get()),
            new OutputFormat());
        xmlSerializer.write(packet.getElement());
              xmlSerializer.flush();
              // IoBuffer流写完
              buffer.flip();
              // 通过session向外写
              ioSession.write(buffer);
              deliverSuccessfully = true;
View Full Code Here

TOP

Related Classes of org.jivesoftware.util.XMLWriter

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.