*/
public String getAttachmentSpecType() {
if (this.applicationType == null) {
ContentType contentType = delegate.getContentType();
if (contentType == null) {
throw new OMException("Unable to determine the attachment spec type because the " +
"Attachments object doesn't have a known content type");
}
applicationType = contentType.getParameter("type");
if ((MTOMConstants.MTOM_TYPE).equalsIgnoreCase(applicationType)) {
this.applicationType = MTOMConstants.MTOM_TYPE;
} else if ((MTOMConstants.SWA_TYPE).equalsIgnoreCase(applicationType)) {
this.applicationType = MTOMConstants.SWA_TYPE;
} else if ((MTOMConstants.SWA_TYPE_12).equalsIgnoreCase(applicationType)) {
this.applicationType = MTOMConstants.SWA_TYPE_12;
} else {
throw new OMException(
"Invalid Application type. Support available for MTOM & SwA only.");
}
}
return this.applicationType;
}