Package org.apache.axiom.om.impl

Examples of org.apache.axiom.om.impl.OMMultipartWriter.writePart()


        rootPartWriter.write(writer.toString());
        rootPartWriter.close();

        // Get the collection of ids associated with the attachments
        for (String id: attachments.getAllContentIDs()) {
          mpw.writePart(attachments.getDataHandler(id), id);
        }

        mpw.complete();
      }
      catch (IOException ex) {
View Full Code Here


                DataHandler rootDataHandler = new DataHandler(busObject);
                if (!rootDataHandler.getContentType().equals(contentType)) {
                    rootDataHandler = new WrappedDataHandler(rootDataHandler, contentType);
                }
                try {
                    mpw.writePart(rootDataHandler, format.getRootContentId());
                    for (String cid : attachments.keySet()) {
                        mpw.writePart(attachments.get(cid), cid);
                    }
                    mpw.complete();
                    outputStream.flush();
View Full Code Here

                    rootDataHandler = new WrappedDataHandler(rootDataHandler, contentType);
                }
                try {
                    mpw.writePart(rootDataHandler, format.getRootContentId());
                    for (String cid : attachments.keySet()) {
                        mpw.writePart(attachments.get(cid), cid);
                    }
                    mpw.complete();
                    outputStream.flush();
                } catch (IOException ex) {
                    throw AxisFault.makeFault(ex);
View Full Code Here

                OMMultipartWriter mpw = new OMMultipartWriter(out, format);
                OutputStream rootPartOutputStream = mpw.writeRootPart();
                envelope.serialize(rootPartOutputStream);
                rootPartOutputStream.close();
                for (AttachmentPart ap : attachmentParts) {
                    mpw.writePart(ap.getDataHandler(), ap.getContentId());
                }
                mpw.complete();
            }

            saveRequired = true;
View Full Code Here

                attachmentsWriter = new OMMultipartWriter(innerOutputStream, innerFormat);
            }
           
            Attachments attachments = msgCtxt.getAttachmentMap();
            for (String contentID : attachments.getAllContentIDs()) {
                attachmentsWriter.writePart(attachments.getDataHandler(contentID), contentID);
            }
           
            if (MM7CompatMode) {
                attachmentsWriter.complete();
                innerOutputStream.close();
View Full Code Here

                OMMultipartWriter mpw = new OMMultipartWriter(out, format);
                OutputStream rootPartOutputStream = mpw.writeRootPart();
                envelope.serialize(rootPartOutputStream);
                rootPartOutputStream.close();
                for (AttachmentPart ap : attachmentParts) {
                    mpw.writePart(ap.getDataHandler(), ap.getContentId());
                }
                mpw.complete();
            }
            saveChanges();
        } catch (Exception e) {
View Full Code Here

                OMMultipartWriter mpw = new OMMultipartWriter(out, format);
                OutputStream rootPartOutputStream = mpw.writeRootPart();
                envelope.serialize(rootPartOutputStream);
                rootPartOutputStream.close();
                for (AttachmentPart ap : attachmentParts) {
                    mpw.writePart(ap.getDataHandler(), ap.getContentId());
                }
                mpw.complete();
            }

            saveRequired = true;
View Full Code Here

                OMMultipartWriter mpw = new OMMultipartWriter(out, format);
                OutputStream rootPartOutputStream = mpw.writeRootPart();
                envelope.serialize(rootPartOutputStream);
                rootPartOutputStream.close();
                for (AttachmentPart ap : attachmentParts) {
                    mpw.writePart(ap.getDataHandler(), ap.getContentId());
                }
                mpw.complete();
            }

            saveRequired = true;
View Full Code Here

                if (iter2.hasNext()) {
                    OMElement omElement =
                            omFactory.createOMElement(ele.getQName().getLocalPart(), null);
                    omElement.addChild(
                            processComplexType(omElement, ele.getChildElements(), omFactory));                  
                    OutputStream partOutputStream = writer.writePart(DEFAULT_CONTENT_TYPE, null,
                            Collections.singletonList(new Header("Content-Disposition",
                                    DISPOSITION_TYPE + "; name=\"" + omElement.getLocalName() + "\"")));
                    partOutputStream.write(omElement.toString().getBytes());
                    partOutputStream.close();
                } else {
View Full Code Here

                            Collections.singletonList(new Header("Content-Disposition",
                                    DISPOSITION_TYPE + "; name=\"" + omElement.getLocalName() + "\"")));
                    partOutputStream.write(omElement.toString().getBytes());
                    partOutputStream.close();
                } else {
                    OutputStream partOutputStream = writer.writePart(DEFAULT_CONTENT_TYPE, null,
                            Collections.singletonList(new Header("Content-Disposition",
                                    DISPOSITION_TYPE + "; name=\"" + ele.getLocalName() + "\"")));
                    partOutputStream.write(ele.getText().getBytes());
                    partOutputStream.close();
                }
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.