Examples of XOPEncodingStreamWriter


Examples of org.apache.axiom.util.stax.xop.XOPEncodingStreamWriter

            log.debug("The XML writing is completed.  Now the attachments are written");
            isComplete = true;
            try {
                rootPartOutputStream.close();
                // First write the attachments added properly through the DataHandlerWriter extension
                XOPEncodingStreamWriter encoder = (XOPEncodingStreamWriter)xmlWriter;
                for (Iterator it = encoder.getContentIDs().iterator(); it.hasNext(); ) {
                    String contentID = (String)it.next();
                    DataHandler dataHandler = encoder.getDataHandler(contentID);
                    if (preserveAttachments || !(dataHandler instanceof DataHandlerExt)) {
                        multipartWriter.writePart(dataHandler, contentID);
                    } else {
                        OutputStream out = multipartWriter.writePart(dataHandler.getContentType(), contentID);
                        BufferUtils.inputStream2OutputStream(((DataHandlerExt)dataHandler).readOnce(), out);
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.