com.eviware.soapui.impl.wsdl.submit.transports.http
Class AttachmentUtils

java.lang.Object
  extended by com.eviware.soapui.impl.wsdl.submit.transports.http.AttachmentUtils

public class AttachmentUtils
extends java.lang.Object

Attachment-related utility classes

Author:
ole.matzura

Field Summary
static javax.mail.Session JAVAMAIL_SESSION
           
static java.lang.String ROOTPART_SOAPUI_ORG
           
static javax.xml.namespace.QName XOP_HREF_QNAME
           
 
Constructor Summary
AttachmentUtils()
           
 
Method Summary
static void addMimeParts(AttachmentContainer container, javax.mail.internet.MimeMultipart mp, StringToStringMap contentIds)
          Adds defined attachments as mimeparts
static void addMultipartAttachment(javax.mail.internet.MimeMultipart mp, StringToStringMap contentIds, java.util.List<Attachment> attachments)
          Adds a mulitpart MimeBodyPart from an array of attachments
static void addSingleAttachment(javax.mail.internet.MimeMultipart mp, StringToStringMap contentIds, Attachment att)
          Adds a simple MimeBodyPart from an attachment
static java.lang.String buildMTOMContentType(java.lang.String header, java.lang.String action, SoapVersion soapVersion)
           
static java.lang.String buildRootPartContentType(java.lang.String action, SoapVersion soapVersion)
           
static java.util.List<WsdlAttachmentPart> extractAttachmentParts(WsdlOperation operation, java.lang.String messageContent, boolean addAnonymous, boolean isResponse)
           
static Attachment.AttachmentEncoding getAttachmentEncoding(WsdlOperation operation, java.lang.String partName, boolean isResponse)
           
static java.lang.String getXmlMimeContentType(org.apache.xmlbeans.XmlCursor cursor)
           
static void initPartContentId(StringToStringMap contentIds, javax.mail.internet.MimeBodyPart part, Attachment attachment, boolean isMultipart)
           
static boolean isSwaRefType(org.apache.xmlbeans.SchemaType schemaType)
           
static boolean isXopInclude(org.apache.xmlbeans.SchemaType schemaType)
           
static boolean prepareMessagePart(AttachmentContainer container, javax.mail.internet.MimeMultipart mp, MessageXmlPart messagePart, StringToStringMap contentIds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XOP_HREF_QNAME

public static final javax.xml.namespace.QName XOP_HREF_QNAME

ROOTPART_SOAPUI_ORG

public static final java.lang.String ROOTPART_SOAPUI_ORG
See Also:
Constant Field Values

JAVAMAIL_SESSION

public static final javax.mail.Session JAVAMAIL_SESSION
Constructor Detail

AttachmentUtils

public AttachmentUtils()
Method Detail

prepareMessagePart

public static boolean prepareMessagePart(AttachmentContainer container,
                                         javax.mail.internet.MimeMultipart mp,
                                         MessageXmlPart messagePart,
                                         StringToStringMap contentIds)
                                  throws java.lang.Exception,
                                         javax.mail.MessagingException
Throws:
java.lang.Exception
javax.mail.MessagingException

buildRootPartContentType

public static java.lang.String buildRootPartContentType(java.lang.String action,
                                                        SoapVersion soapVersion)

buildMTOMContentType

public static java.lang.String buildMTOMContentType(java.lang.String header,
                                                    java.lang.String action,
                                                    SoapVersion soapVersion)

isSwaRefType

public static boolean isSwaRefType(org.apache.xmlbeans.SchemaType schemaType)

getXmlMimeContentType

public static java.lang.String getXmlMimeContentType(org.apache.xmlbeans.XmlCursor cursor)

getAttachmentEncoding

public static Attachment.AttachmentEncoding getAttachmentEncoding(WsdlOperation operation,
                                                                  java.lang.String partName,
                                                                  boolean isResponse)

isXopInclude

public static boolean isXopInclude(org.apache.xmlbeans.SchemaType schemaType)

extractAttachmentParts

public static java.util.List<WsdlAttachmentPart> extractAttachmentParts(WsdlOperation operation,
                                                                        java.lang.String messageContent,
                                                                        boolean addAnonymous,
                                                                        boolean isResponse)

addMimeParts

public static void addMimeParts(AttachmentContainer container,
                                javax.mail.internet.MimeMultipart mp,
                                StringToStringMap contentIds)
                         throws javax.mail.MessagingException
Adds defined attachments as mimeparts

Throws:
javax.mail.MessagingException

addMultipartAttachment

public static void addMultipartAttachment(javax.mail.internet.MimeMultipart mp,
                                          StringToStringMap contentIds,
                                          java.util.List<Attachment> attachments)
                                   throws javax.mail.MessagingException
Adds a mulitpart MimeBodyPart from an array of attachments

Throws:
javax.mail.MessagingException

initPartContentId

public static void initPartContentId(StringToStringMap contentIds,
                                     javax.mail.internet.MimeBodyPart part,
                                     Attachment attachment,
                                     boolean isMultipart)
                              throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

addSingleAttachment

public static void addSingleAttachment(javax.mail.internet.MimeMultipart mp,
                                       StringToStringMap contentIds,
                                       Attachment att)
                                throws javax.mail.MessagingException
Adds a simple MimeBodyPart from an attachment

Throws:
javax.mail.MessagingException


Copyright © 2005-2008 eviware.com. All Rights Reserved.