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
IOException
org.apache.james.mime4j.MimeException
public Map<String,String> contentTypeParameters()
MimeDescriptor
Content-Type
.contentTypeParameters
in interface MimeDescriptor
Header
Iterator
, not nullpublic MimeDescriptor embeddedMessage()
MimeDescriptor
embeddedMessage
in interface MimeDescriptor
MimeDescriptor
when top level MIME type is
message
, null otherwisepublic long getBodyOctets()
MimeDescriptor
getBodyOctets
in interface MimeDescriptor
public String getContentDescription()
MimeDescriptor
Content-Description
header value.getContentDescription
in interface MimeDescriptor
Content-Description
, possibly nullpublic String getContentID()
MimeDescriptor
Content-ID
header value.getContentID
in interface MimeDescriptor
Content-ID
, possibly nullpublic long getLines()
MimeDescriptor
TEXT
when
transfer encoded.getLines
in interface MimeDescriptor
CRLF
count when a TEXT
type, otherwise
-1public String getMimeSubType()
MimeDescriptor
getMimeSubType
in interface MimeDescriptor
public String getMimeType()
MimeDescriptor
getMimeType
in interface MimeDescriptor
public String getTransferContentEncoding()
MimeDescriptor
getTransferContentEncoding
in interface MimeDescriptor
Content-Transfer-Encoding
, possibly nullpublic Iterator<MessageResult.Header> headers()
Headers
headers
in interface Headers
Header
Iterator
, or null if
MessageResult.FetchGroup.HEADERS
was not fetchedpublic Iterator<MimeDescriptor> parts()
MimeDescriptor
parts
in interface MimeDescriptor
MimeDescriptor
Iterator
when a
composite top level MIME media type, null otherwisepublic List<String> getLanguages()
MimeDescriptor
Content-Language
header
value.getLanguages
in interface MimeDescriptor
List
of String
namespublic String getDisposition()
MimeDescriptor
Content-Disposition
.getDisposition
in interface MimeDescriptor
Content-Disposition
, or null if no disposition
header existspublic Map<String,String> getDispositionParams()
MimeDescriptor
Content-Disposition
parameters.getDispositionParams
in interface MimeDescriptor
Content-Disposition
values indexed by namespublic String getContentLocation()
MimeDescriptor
Content-Location
header value.getContentLocation
in interface MimeDescriptor
Content-Location
, possibly nullpublic String getContentMD5()
MimeDescriptor
Content-MD5
header value.getContentMD5
in interface MimeDescriptor
Content-MD5
, possibly nullpublic InputStream getInputStream() throws IOException
Content
InputStream
getInputStream
in interface Content
IOException
public long size() throws MailboxException
Content
size
in interface Content
MailboxException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.