Package org.apache.cxf.attachment

Examples of org.apache.cxf.attachment.AttachmentDataSource


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

        Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
        if ((Boolean.TRUE.equals(en) || "true".equals(en)) && 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();
                    } catch (IOException e) {
                        throw new Fault(e);
                    }
                    dss.add(ds);
                }
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

        Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
        if ((Boolean.TRUE.equals(en) || "true".equals(en)) && 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();
                    } catch (IOException e) {
                        throw new Fault(e);
                    }
                    dss.add(ds);
                }
View Full Code Here

        Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
        if ((Boolean.TRUE.equals(en) || "true".equals(en)) && 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 = (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.