public class MimeDescriptorImpl extends Object implements MimeDescriptor
| Constructor and Description |
|---|
MimeDescriptorImpl(long bodyOctets,
String contentDescription,
String contentId,
long lines,
String subType,
String type,
String transferEncoding,
Collection<MessageResult.Header> headers,
Map<String,String> contentTypeParameters,
List<String> languages,
String disposition,
Map<String,String> dispositionParams,
MimeDescriptor embeddedMessage,
Collection<MimeDescriptor> parts,
String location,
String md5) |
| Modifier and Type | Method and Description |
|---|---|
static MimeDescriptorImpl |
build(InputStream stream) |
Map<String,String> |
contentTypeParameters()
Gets MIME body parameters parsed from
Content-Type. |
MimeDescriptor |
embeddedMessage()
Gets embedded message.
|
long |
getBodyOctets()
The number of octets contained in the body of this part.
|
String |
getContentDescription()
Gets MIME
Content-Description header value. |
String |
getContentID()
Gets the MIME
Content-ID header value. |
String |
getContentLocation()
Gets MIME
Content-Location header value. |
String |
getContentMD5()
Gets MIME
Content-MD5 header value. |
String |
getDisposition()
Gets MIME
Content-Disposition. |
Map<String,String> |
getDispositionParams()
Gets MIME
Content-Disposition parameters. |
InputStream |
getInputStream()
Return the content as
InputStream |
List<String> |
getLanguages()
Gets the languages, From the MIME
Content-Language header
value. |
long |
getLines()
Gets the number of lines of text in a part of type
TEXT when
transfer encoded. |
String |
getMimeSubType()
Gets the MIME content subtype.
|
String |
getMimeType()
Gets the top level MIME content media type.
|
String |
getTransferContentEncoding()
Gets the MIME content transfer encoding.
|
Iterator<MessageResult.Header> |
headers()
Gets headers for the message.
|
static boolean |
isComposite(String mediaType)
Is this a composite media type (as per RFC2045)?
TODO: Move to Mime4j
|
Iterator<MimeDescriptor> |
parts()
Gets parts.
|
long |
size()
Size (in octets) of the content.
|
public MimeDescriptorImpl(long bodyOctets,
String contentDescription,
String contentId,
long lines,
String subType,
String type,
String transferEncoding,
Collection<MessageResult.Header> headers,
Map<String,String> contentTypeParameters,
List<String> languages,
String disposition,
Map<String,String> dispositionParams,
MimeDescriptor embeddedMessage,
Collection<MimeDescriptor> parts,
String location,
String md5)
public static boolean isComposite(String mediaType)
mediaType - possibly nullpublic static MimeDescriptorImpl build(InputStream stream) throws IOException, org.apache.james.mime4j.MimeException
IOExceptionorg.apache.james.mime4j.MimeExceptionpublic Map<String,String> contentTypeParameters()
MimeDescriptorContent-Type.contentTypeParameters in interface MimeDescriptorHeader Iterator, not nullpublic MimeDescriptor embeddedMessage()
MimeDescriptorembeddedMessage in interface MimeDescriptorMimeDescriptor when top level MIME type is
message, null otherwisepublic long getBodyOctets()
MimeDescriptorgetBodyOctets in interface MimeDescriptorpublic String getContentDescription()
MimeDescriptorContent-Description header value.getContentDescription in interface MimeDescriptorContent-Description, possibly nullpublic String getContentID()
MimeDescriptorContent-ID header value.getContentID in interface MimeDescriptorContent-ID, possibly nullpublic long getLines()
MimeDescriptorTEXT when
transfer encoded.getLines in interface MimeDescriptorCRLF count when a TEXT type, otherwise
-1public String getMimeSubType()
MimeDescriptorgetMimeSubType in interface MimeDescriptorpublic String getMimeType()
MimeDescriptorgetMimeType in interface MimeDescriptorpublic String getTransferContentEncoding()
MimeDescriptorgetTransferContentEncoding in interface MimeDescriptorContent-Transfer-Encoding, possibly nullpublic Iterator<MessageResult.Header> headers()
Headersheaders in interface HeadersHeader Iterator, or null if
MessageResult.FetchGroup.HEADERS was not fetchedpublic Iterator<MimeDescriptor> parts()
MimeDescriptorparts in interface MimeDescriptorMimeDescriptor Iterator when a
composite top level MIME media type, null otherwisepublic List<String> getLanguages()
MimeDescriptorContent-Language header
value.getLanguages in interface MimeDescriptorList of String namespublic String getDisposition()
MimeDescriptorContent-Disposition.getDisposition in interface MimeDescriptorContent-Disposition, or null if no disposition
header existspublic Map<String,String> getDispositionParams()
MimeDescriptorContent-Disposition parameters.getDispositionParams in interface MimeDescriptorContent-Disposition values indexed by namespublic String getContentLocation()
MimeDescriptorContent-Location header value.getContentLocation in interface MimeDescriptorContent-Location, possibly nullpublic String getContentMD5()
MimeDescriptorContent-MD5 header value.getContentMD5 in interface MimeDescriptorContent-MD5, possibly nullpublic InputStream getInputStream() throws IOException
ContentInputStreamgetInputStream in interface ContentIOExceptionpublic long size()
throws MailboxException
Contentsize in interface ContentMailboxExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.