Examples of AttachmentImpl


Examples of com.sogou.qadev.service.cynthia.bean.impl.AttachmentImpl

      pstm.setTimestamp(5, createTime);
      pstm.setString(6, fileId==null?"":fileId);
      pstm.setBytes(7, data);
      pstm.execute();

      Attachment attachment = new AttachmentImpl(id);
      attachment.setName(name);
      attachment.setCreateUser(username);
      attachment.setCreateTime(createTime);
      attachment.setData(data);
      attachment.setSize(data.length);
      attachment.setFileId(fileId);

      return attachment;
    }
    catch(Exception e){
      e.printStackTrace();
View Full Code Here

Examples of com.sun.xml.ws.security.opt.impl.attachment.AttachmentImpl

                    }
                    checkDecryptedData(she, ek.getPolicy());
                } else {
                    // Handle Encrypted Attachment here
                    byte[] decryptedMimeData = ed.getDecryptedMimeData(ek.getKey(ed.getEncryptionAlgorithm()));
                    Attachment as = new AttachmentImpl(ed.getAttachmentContentId(), decryptedMimeData, ed.getAttachmentMimeType());
                    securityContext.getDecryptedAttachmentSet().add(as);
                    ek.getPendingReferenceList().remove(ed.getId());
                    if (ek.getPendingReferenceList().isEmpty()) {
                        pendingElement = null;
                        bufferedHeaders.remove(ek);
                        addSecurityHeader(ek);
                    }
                }
            } else {
                if (!lookInBufferedHeaders(ed, currentParentNS)) {
                    addSecurityHeader(ed);
                }
            }
        } else if (pendingElement != null && pendingElement instanceof ReferenceListHeader) {
            ReferenceListHeader refList = (ReferenceListHeader) pendingElement;
            if (refList.getPendingReferenceList().contains(ed.getId())) {
                //for policy verification
                refList.getPolicy().setKeyBinding(ed.getInferredKB());
                //

                if (!ed.hasCipherReference()) {
                    XMLStreamReader decryptedData = ed.getDecryptedData();
                    if (decryptedData.getEventType() != XMLStreamReader.START_ELEMENT) {
                        StreamUtil.moveToNextElement(decryptedData);
                    }
                    SecurityHeaderProcessor shp = new SecurityHeaderProcessor(context, currentParentNS, staxIF, creator);
                    SecurityHeaderElement she = shp.createHeader(decryptedData);
                    encIds.put(ed.getId(), she.getId());
                    edAlgos.put(ed.getId(), ed.getEncryptionAlgorithm());
                    refList.getPendingReferenceList().remove(ed.getId());
                    if (refList.getPendingReferenceList().isEmpty()) {
                        pendingElement = null;
                    }
                    checkDecryptedData(she, refList.getPolicy());
                } else {
                    // Handle Encrypted Attachment here
                    byte[] decryptedMimeData = ed.getDecryptedMimeData();
                    Attachment as = new AttachmentImpl(ed.getAttachmentContentId(), decryptedMimeData, ed.getAttachmentMimeType());
                    securityContext.getDecryptedAttachmentSet().add(as);
                    refList.getPendingReferenceList().remove(ed.getId());
                    if (refList.getPendingReferenceList().isEmpty()) {
                        pendingElement = null;
                    }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

            } else {
                throw new Fault(new org.apache.cxf.common.i18n.Message("ATTACHMENT_NOT_SUPPORTED",
                                                                       LOG, o.getClass()));
            }
           
            AttachmentImpl att = new AttachmentImpl(id);
            att.setDataHandler(dh);
            att.setHeader("Content-Type", ct);
            atts.add(att);
        }
    }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

        soapMessage = TestUtil.createEmptySoapMessage(Soap12.getInstance(), chain);
        ByteArrayDataSource bads = new ByteArrayDataSource(this.getClass().getResourceAsStream(message),
                                                           "Application/xop+xml");
        String cid = AttachmentUtil.createContentID("http://cxf.apache.org");
        soapMessage.setContent(Attachment.class, new AttachmentImpl(cid, new DataHandler(bads)));
        soapMessage.setContent(InputStream.class, bads.getInputStream());

    }
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

        responseContext.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
        org.apache.cxf.message.Message cxfMessage = new org.apache.cxf.message.MessageImpl();
        cxfExchange.setInMessage(cxfMessage);
       
        Set<Attachment> attachments = new HashSet<Attachment>();
        attachments.add(new AttachmentImpl("att-1", new DataHandler(new FileDataSource("pom.xml"))));
        cxfMessage.setAttachments(attachments);
       
        cxfBinding.populateExchangeFromCxfResponse(exchange, cxfExchange, responseContext);
       
        Map<String, Object> camelHeaders = exchange.getOut().getHeaders();
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

        headers.put("myfruitheader", Arrays.asList("peach"));
        headers.put("mybrewheader", Arrays.asList("cappuccino", "espresso"));
        cxfMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);

        Set<Attachment> attachments = new HashSet<Attachment>();
        attachments.add(new AttachmentImpl("att-1", new DataHandler(new FileDataSource("pom.xml"))));
        cxfMessage.setAttachments(attachments);
       
        cxfExchange.setInMessage(cxfMessage);

        cxfBinding.populateExchangeFromCxfRequest(cxfExchange, exchange);
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

        responseContext.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
        org.apache.cxf.message.Message cxfMessage = new org.apache.cxf.message.MessageImpl();
        cxfExchange.setInMessage(cxfMessage);
       
        Set<Attachment> attachments = new HashSet<Attachment>();
        attachments.add(new AttachmentImpl("att-1", new DataHandler(new FileDataSource("pom.xml"))));
        cxfMessage.setAttachments(attachments);
       
        cxfBinding.populateExchangeFromCxfResponse(exchange, cxfExchange, responseContext);
       
        Map<String, Object> camelHeaders = exchange.getOut().getHeaders();
View Full Code Here

Examples of org.apache.cxf.attachment.AttachmentImpl

        headers.put("myfruitheader", Arrays.asList("peach"));
        headers.put("mybrewheader", Arrays.asList("cappuccino", "espresso"));
        cxfMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);

        Set<Attachment> attachments = new HashSet<Attachment>();
        attachments.add(new AttachmentImpl("att-1", new DataHandler(new FileDataSource("pom.xml"))));
        cxfMessage.setAttachments(attachments);
       
        cxfExchange.setInMessage(cxfMessage);

        cxfBinding.populateExchangeFromCxfRequest(cxfExchange, exchange);
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.