Search in sources :

Example 1 with AttachmentImpl

use of org.wso2.carbon.attachment.mgt.core.AttachmentImpl in project carbon-business-process by wso2.

the class TransformerUtil method convertAttachment.

/**
 * Transform (DTO) {@link TAttachment} to {@link Attachment}
 *
 * @param attachment
 * @return
 * @throws AttachmentMgtException
 */
public static Attachment convertAttachment(TAttachment attachment) throws AttachmentMgtException {
    Attachment attachmentDTO = null;
    attachmentDTO = new AttachmentImpl(attachment.getName(), attachment.getCreatedBy(), attachment.getContentType(), attachment.getContent(), attachment.getCreatedTime().getTime());
    return attachmentDTO;
}
Also used : TAttachment(org.wso2.carbon.attachment.mgt.skeleton.types.TAttachment) Attachment(org.wso2.carbon.attachment.mgt.api.attachment.Attachment) AttachmentImpl(org.wso2.carbon.attachment.mgt.core.AttachmentImpl)

Aggregations

Attachment (org.wso2.carbon.attachment.mgt.api.attachment.Attachment)1 AttachmentImpl (org.wso2.carbon.attachment.mgt.core.AttachmentImpl)1 TAttachment (org.wso2.carbon.attachment.mgt.skeleton.types.TAttachment)1