Examples of AttachmentImpl


Examples of org.apache.cxf.attachment.AttachmentImpl

    @Override
    protected Attachment createAttachment(Object object, String id) {
        DataHandler handler = (DataHandler)object;

        AttachmentImpl att = new AttachmentImpl(id, handler);
        att.setXOP(true);

        return att;
    }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

    protected Attachment createAttachment(Object object, String id) {
        byte[] data = (byte[])object;

        ByteDataSource source = new ByteDataSource(data);
        source.setContentType(getContentType(object, null));
        AttachmentImpl att = new AttachmentImpl(id, new DataHandler(source));
        att.setXOP(true);

        return att;
    }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

    @Override
    protected Attachment createAttachment(Object object, String id) {
        DataSource source = (DataSource)object;

        DataHandler handler = new DataHandler(source);
        AttachmentImpl att = new AttachmentImpl(id, handler);
        att.setXOP(true);
        return att;
    }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

                if (attachments == null) {
                    attachments = new ArrayList<Attachment>();
                    out.setAttachments(attachments);
                }
                for (Map.Entry<String, DataHandler> entry : dataHandlers.entrySet()) {
                    Attachment att = new AttachmentImpl(entry.getKey(), entry.getValue());
                    attachments.add(att);
                }
            }
            out.remove(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
        }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

        boolean isXop = Boolean.valueOf(camelExchange.getProperty(Message.MTOM_ENABLED, String.class));
        for (Map.Entry<String, DataHandler> entry : camelExchange.getIn().getAttachments().entrySet()) {
            if (attachments == null) {
                attachments = new HashSet<Attachment>();
            }
            AttachmentImpl attachment = new AttachmentImpl(entry.getKey(), entry.getValue());
            attachment.setXOP(isXop);
            attachments.add(attachment);
        }
       
        if (attachments != null) {
            requestContext.put(CxfConstants.CAMEL_CXF_ATTACHMENTS, attachments);
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

            boolean isXop = Boolean.valueOf(camelExchange.getProperty(Message.MTOM_ENABLED, String.class));
            for (Map.Entry<String, DataHandler> entry : camelExchange.getOut().getAttachments().entrySet()) {
                if (attachments == null) {
                    attachments = new HashSet<Attachment>();
                }
                AttachmentImpl attachment = new AttachmentImpl(entry.getKey(), entry.getValue());
                attachment.setXOP(isXop);
                attachments.add(attachment);
            }
           
            if (attachments != null) {
                outMessage.setAttachments(attachments);
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

                    }
                    Iterator<AttachmentPart> it = CastUtils.cast(soapMessage.getAttachments());
                    while (it.hasNext()) {
                        AttachmentPart part = it.next();
                        String id = AttachmentUtil.cleanContentId(part.getContentId());
                        AttachmentImpl att = new AttachmentImpl(id);
                        try {
                            att.setDataHandler(part.getDataHandler());
                        } catch (SOAPException e) {
                            throw new Fault(e);
                        }
                        Iterator<MimeHeader> it2 = CastUtils.cast(part.getAllMimeHeaders());
                        while (it2.hasNext()) {
                            MimeHeader header = it2.next();
                            att.setHeader(header.getName(), header.getValue());
                        }
                        message.getAttachments().add(att);
                    }
                }
               
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

        List<org.apache.cxf.message.Attachment> atts =
            new ArrayList<org.apache.cxf.message.Attachment>();
       
        for (int i = 1; i < handlers.size(); i++) {
            Attachment handler = (Attachment)handlers.get(i);
            AttachmentImpl att = new AttachmentImpl(handler.getContentId(), handler.getDataHandler());
            for (String key : handler.getHeaders().keySet()) {
                att.setHeader(key, handler.getHeader(key));
            }
            att.setXOP(false);
            atts.add(att);
        }
        Message outMessage = getOutMessage();
        outMessage.setAttachments(atts);
        outMessage.put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, "true");
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

        boolean isXop = Boolean.valueOf(camelExchange.getProperty(Message.MTOM_ENABLED, String.class));
        for (Map.Entry<String, DataHandler> entry : camelExchange.getIn().getAttachments().entrySet()) {
            if (attachments == null) {
                attachments = new HashSet<Attachment>();
            }
            AttachmentImpl attachment = new AttachmentImpl(entry.getKey(), entry.getValue());
            attachment.setXOP(isXop);
            attachments.add(attachment);
        }
       
        if (attachments != null) {
            requestContext.put(CxfConstants.CAMEL_CXF_ATTACHMENTS, attachments);
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

            boolean isXop = Boolean.valueOf(camelExchange.getProperty(Message.MTOM_ENABLED, String.class));
            for (Map.Entry<String, DataHandler> entry : camelExchange.getOut().getAttachments().entrySet()) {
                if (attachments == null) {
                    attachments = new HashSet<Attachment>();
                }
                AttachmentImpl attachment = new AttachmentImpl(entry.getKey(), entry.getValue());
                attachment.setXOP(isXop);
                attachments.add(attachment);
            }
           
            if (attachments != null) {
                outMessage.setAttachments(attachments);
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.