Package org.apache.cxf.attachment

Examples of org.apache.cxf.attachment.AttachmentDataSource


                org.apache.cxf.attachment.AttachmentImpl securedAttachment =
                    new org.apache.cxf.attachment.AttachmentImpl(
                        attachmentResultCallback.getAttachmentId(),
                        new DataHandler(
                            new AttachmentDataSource(
                                attachmentResultCallback.getAttachment().getMimeType(),
                                attachmentResultCallback.getAttachment().getSourceStream())
                        )
                    );
                Map<String, String> headers = attachmentResultCallback.getAttachment().getHeaders();
View Full Code Here


        if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.IN, message)
            && message.getAttachments() != null) {
            Collection<AttachmentDataSource> dss = new ArrayList<AttachmentDataSource>();
            for (Attachment at : message.getAttachments()) {
                if (at.getDataHandler().getDataSource() instanceof AttachmentDataSource) {
                    AttachmentDataSource ds = (AttachmentDataSource)at.getDataHandler().getDataSource();
                    try {
                        ds.hold(message);
                    } catch (IOException e) {
                        throw new Fault(e);
                    }
                    dss.add(ds);
                }
View Full Code Here

            // add output attachments
            map = CastUtils.cast((Map<?, ?>)ctx.getMessageContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS));

            try {
                DataSource ds = new AttachmentDataSource("image/jpeg", getClass().getResourceAsStream("/Splash.jpg"));
                map.put(MtomTestHelper.RESP_IMAGE_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
            }
           
            try {
                DataSource ds = new AttachmentDataSource("application/octet-stream",
                                                         new ByteArrayInputStream(MtomTestHelper.RESP_PHOTO_DATA));
                map.put(MtomTestHelper.RESP_PHOTO_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
View Full Code Here

            // add output attachments
            map = CastUtils.cast((Map<?, ?>)ctx.getMessageContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS));

            try {
                DataSource ds = new AttachmentDataSource("image/jpeg", getClass().getResourceAsStream("/Splash.jpg"));
                map.put(MtomTestHelper.RESP_IMAGE_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
            }
           
            try {
                DataSource ds = new AttachmentDataSource("application/octet-stream",
                                                         new ByteArrayInputStream(MtomTestHelper.RESP_PHOTO_DATA));
                map.put(MtomTestHelper.RESP_PHOTO_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
View Full Code Here

            // add output attachments
            map = (Map) ctx.getMessageContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);

            try {
                DataSource ds = new AttachmentDataSource("image/jpeg", getClass().getResourceAsStream("/Splash.jpg"));
                map.put(MtomTestHelper.RESP_IMAGE_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
            }
           
            try {
                DataSource ds = new AttachmentDataSource("application/octet-stream",
                                                         new ByteArrayInputStream(MtomTestHelper.RESP_PHOTO_DATA));
                map.put(MtomTestHelper.RESP_PHOTO_CID, new DataHandler(ds));
               
            } catch (IOException e) {
                e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.cxf.attachment.AttachmentDataSource

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.