Package com.sun.xml.ws.api.message

Examples of com.sun.xml.ws.api.message.Attachment


        return a.asDataHandler();
    }

    @Override
    public byte[] getAttachmentAsByteArray(String cid) {
        Attachment a = attachments.get(stripScheme(cid));
        if(a==null)
            throw new WebServiceException(EncodingMessages.NO_SUCH_CONTENT_ID(cid));
        return a.asByteArray();
    }
View Full Code Here


        this.mpp = mpp;
    }

    @Nullable
    public Attachment get(String contentId) {
        Attachment att;
        /**
         * First try to get the Attachment from internal map, maybe this attachment
         * is added by the user.
         */
        att = atts.get(contentId);
View Full Code Here

        AttachmentSet newAttachmentSet = new AttachmentSetImpl();
        for(Attachment attachment : as){
            SecurityHeaderElement ed = (SecurityHeaderElement)wsf.createEncryptedData(context.generateID(), attachment, dataEncAlg, ki, key, (EncryptionTarget)target);
            context.getSecurityHeader().add(ed);
            edList.add(ed);
            Attachment encryptedAttachment = new EncryptedAttachment(attachment, dataEncAlg, key);
            newAttachmentSet.add(encryptedAttachment);
        }
        message.setAttachments(newAttachmentSet);
    }
View Full Code Here

            add(a);
    }

    public Attachment get(String contentId) {
        for( int i=attList.size()-1; i>=0; i-- ) {
            Attachment a = attList.get(i);
            if(a.getContentId().equals(contentId))
                return a;
        }
        return null;
    }
View Full Code Here

       
        public void fillIn(Object[] methodArgs, Object returnValue, Message msg) {
            String contentId = getContentId();
            Object obj = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
            if (obj != null) {
                Attachment att = new ByteArrayAttachment(contentId,(byte[])obj,mimeType);
                msg.getAttachments().add(att);
            }
        }
View Full Code Here

       
        public void fillIn(Object[] methodArgs, Object returnValue, Message msg) {
            String contentId = getContentId();
            Object obj = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
            DataHandler dh = (obj instanceof DataHandler) ? (DataHandler)obj : new DataHandler(obj,mimeType);
            Attachment att = new DataHandlerAttachment(contentId, dh);
            msg.getAttachments().add(att);
        }
View Full Code Here

        }
       
        public void fillIn(Object[] methodArgs, Object returnValue, Message msg) {
            String contentId = getContentId();
            Object obj = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
            Attachment att = new JAXBAttachment(contentId, obj, param.getXMLBridge(), mimeType);
            msg.getAttachments().add(att);
        }
View Full Code Here

            add(a);
    }

    public Attachment get(String contentId) {
        for( int i=attList.size()-1; i>=0; i-- ) {
            Attachment a = attList.get(i);
            if(a.getContentId().equals(contentId))
                return a;
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.api.message.Attachment

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.