public class LazyMimeDescriptor extends Object implements MimeDescriptor
MimeDescriptor
implementation which tries to optimize the way the data
is loading by using it in a lazy fashion whenever possible.Constructor and Description |
---|
LazyMimeDescriptor(MessageResult result,
Message<?> message) |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
contentTypeParameters()
Gets MIME body parameters parsed from
Content-Type . |
MimeDescriptor |
embeddedMessage()
Return null
|
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.
|
Iterator<MimeDescriptor> |
parts()
Gets parts.
|
long |
size()
Size (in octets) of the content.
|
public LazyMimeDescriptor(MessageResult result, Message<?> message)
public Iterator<MessageResult.Header> headers() throws MailboxException
Headers
headers
in interface Headers
Header
Iterator
, or null if
MessageResult.FetchGroup.HEADERS
was not fetchedMailboxException
public InputStream getInputStream() throws IOException
Content
InputStream
getInputStream
in interface Content
IOException
public long size() throws MailboxException
Content
size
in interface Content
MailboxException
public String getMimeType()
MimeDescriptor
getMimeType
in interface MimeDescriptor
public String getMimeSubType()
MimeDescriptor
getMimeSubType
in interface MimeDescriptor
public String getContentID()
MimeDescriptor
Content-ID
header value.getContentID
in interface MimeDescriptor
Content-ID
, possibly nullpublic String getContentDescription()
MimeDescriptor
Content-Description
header value.getContentDescription
in interface MimeDescriptor
Content-Description
, possibly nullpublic 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 String getTransferContentEncoding()
MimeDescriptor
getTransferContentEncoding
in interface MimeDescriptor
Content-Transfer-Encoding
, possibly nullpublic 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 long getLines()
MimeDescriptor
TEXT
when
transfer encoded.getLines
in interface MimeDescriptor
CRLF
count when a TEXT
type, otherwise
-1public long getBodyOctets()
MimeDescriptor
getBodyOctets
in interface MimeDescriptor
public Iterator<MimeDescriptor> parts()
MimeDescriptor
parts
in interface MimeDescriptor
MimeDescriptor
Iterator
when a
composite top level MIME media type, null otherwisepublic MimeDescriptor embeddedMessage()
embeddedMessage
in interface MimeDescriptor
MimeDescriptor
when top level MIME type is
message
, null otherwisepublic Map<String,String> contentTypeParameters()
MimeDescriptor
Content-Type
.contentTypeParameters
in interface MimeDescriptor
Header
Iterator
, not nullCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.