public boolean equals(Object other) { if (other instanceof ContentTypeHeader) { final ContentTypeHeader o = (ContentTypeHeader) other; return this.getContentType().equalsIgnoreCase( o.getContentType() ) && this.getContentSubType().equalsIgnoreCase( o.getContentSubType() ) && equalParameters( o ); } return false; } }
/** * Creates a default content list. */ public MultipartMimeContentImpl(ContentTypeHeader contentTypeHeader) { this.multipartMimeContentTypeHeader = contentTypeHeader; this.boundary = contentTypeHeader.getParameter(BOUNDARY); }
String delimiter = contentTypeHeader.getParameter(MULTIPART_BOUNDARY); String start = contentTypeHeader.getParameter(MULTIPART_START); MimeMultipart mimeMultipart = new MimeMultipart(contentTypeHeader.getContentSubType()); if (delimiter == null) { MimeBodyPart mbp = new MimeBodyPart(); DataSource ds = new ByteArrayDataSource(rawContent, contentTypeHeader.getContentSubType()); try { mbp.setDataHandler(new DataHandler(ds)); String contentType = contentTypeHeader.getContentSubType();
this.message.getHeader(ContentTypeHeader.NAME); if(contentTypeHeader != null && logger.isDebugEnabled()) { logger.debug("Content type " + contentTypeHeader.getContentType()); logger.debug("Content sub type " + contentTypeHeader.getContentSubType()); if(contentTypeHeader!= null && CONTENT_TYPE_TEXT.equals(contentTypeHeader.getContentType())) { String content = null; if(message.getRawContent() != null) { } else if(contentTypeHeader!= null && CONTENT_TYPE_MULTIPART.equals(contentTypeHeader.getContentType())) { try { return new MimeMultipart(new ByteArrayDataSource(message.getRawContent(),
public String getCharacterEncoding() { if (this.message.getContentEncoding() != null) { return this.message.getContentEncoding().getEncoding(); } else { ContentTypeHeader cth = (ContentTypeHeader) this.message.getHeader(ContentTypeHeader.NAME); if(cth == null) return null; return cth.getParameter("charset"); } }
if (contentType != null) { notify.setContentType(contentType.getContentType()); notify.setContentSubType(contentType.getContentSubType()); notify.setContent(new String(request.getRawContent()));
public MultipartMimeContent createMultipartMimeContent(ContentTypeHeader multipartMimeCth, String[] contentType, String[] contentSubtype, String[] contentBody) { String boundary = multipartMimeCth.getParameter("boundary"); MultipartMimeContentImpl retval = new MultipartMimeContentImpl(multipartMimeCth); for (int i = 0 ; i < contentType.length; i++ ) { ContentTypeHeader cth = new ContentType(contentType[i],contentSubtype[i]); ContentImpl contentImpl = new ContentImpl(contentBody[i]); contentImpl.setContentTypeHeader(cth); retval.add(contentImpl); } return retval; }