org.apache.james.mailboxmanager.torque
Class MimeDescriptorImpl

java.lang.Object
  extended by org.apache.james.mailboxmanager.torque.MimeDescriptorImpl
All Implemented Interfaces:
Headers, MessageResult.MimeDescriptor

public class MimeDescriptorImpl
extends java.lang.Object
implements MessageResult.MimeDescriptor


Constructor Summary
MimeDescriptorImpl(long bodyOctets, java.lang.String contentDescription, java.lang.String contentId, long lines, java.lang.String subType, java.lang.String type, java.lang.String transferEncoding, java.util.Collection headers, java.util.Collection contentTypeParameters, java.util.List languages, java.lang.String disposition, java.util.Map dispositionParams, MessageResult.MimeDescriptor embeddedMessage, java.util.Collection parts, java.lang.String location, java.lang.String md5)
           
 
Method Summary
static MimeDescriptorImpl build(java.io.InputStream stream)
           
 java.util.Iterator contentTypeParameters()
          Gets MIME body parameters parsed from Content-Type.
 MessageResult.MimeDescriptor embeddedMessage()
          Gets embedded message.
 long getBodyOctets()
          The number of octets contained in the body of this part.
 java.lang.String getContentDescription()
          Gets MIME Content-Description header value.
 java.lang.String getContentID()
          Gets the MIME Content-ID header value.
 java.lang.String getContentLocation()
          Gets MIME Content-Location header value.
 java.lang.String getContentMD5()
          Gets MIME Content-MD5 header value.
 java.lang.String getDisposition()
          Gets MIME Content-Disposition.
 java.util.Map getDispositionParams()
          Gets MIME Content-Disposition parameters.
 java.util.List 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.
 java.lang.String getMimeSubType()
          Gets the MIME content subtype.
 java.lang.String getMimeType()
          Gets the top level MIME content media type.
 java.lang.String getTransferContentEncoding()
          Gets the MIME content transfer encoding.
 java.util.Iterator headers()
          Gets headers for the message.
 java.util.Iterator parts()
          Gets parts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeDescriptorImpl

public MimeDescriptorImpl(long bodyOctets,
                          java.lang.String contentDescription,
                          java.lang.String contentId,
                          long lines,
                          java.lang.String subType,
                          java.lang.String type,
                          java.lang.String transferEncoding,
                          java.util.Collection headers,
                          java.util.Collection contentTypeParameters,
                          java.util.List languages,
                          java.lang.String disposition,
                          java.util.Map dispositionParams,
                          MessageResult.MimeDescriptor embeddedMessage,
                          java.util.Collection parts,
                          java.lang.String location,
                          java.lang.String md5)
Method Detail

build

public static MimeDescriptorImpl build(java.io.InputStream stream)
                                throws java.io.IOException
Throws:
java.io.IOException

contentTypeParameters

public java.util.Iterator contentTypeParameters()
Description copied from interface: MessageResult.MimeDescriptor
Gets MIME body parameters parsed from Content-Type.

Specified by:
contentTypeParameters in interface MessageResult.MimeDescriptor
Returns:
Header Iterator, not null

embeddedMessage

public MessageResult.MimeDescriptor embeddedMessage()
Description copied from interface: MessageResult.MimeDescriptor
Gets embedded message.

Specified by:
embeddedMessage in interface MessageResult.MimeDescriptor
Returns:
MimeDescriptor when top level MIME type is message, null otherwise

getBodyOctets

public long getBodyOctets()
Description copied from interface: MessageResult.MimeDescriptor
The number of octets contained in the body of this part.

Specified by:
getBodyOctets in interface MessageResult.MimeDescriptor
Returns:
number of octets

getContentDescription

public java.lang.String getContentDescription()
Description copied from interface: MessageResult.MimeDescriptor
Gets MIME Content-Description header value.

Specified by:
getContentDescription in interface MessageResult.MimeDescriptor
Returns:
MIME Content-Description, possibly null

getContentID

public java.lang.String getContentID()
Description copied from interface: MessageResult.MimeDescriptor
Gets the MIME Content-ID header value.

Specified by:
getContentID in interface MessageResult.MimeDescriptor
Returns:
MIME Content-ID, possibly null

getLines

public long getLines()
Description copied from interface: MessageResult.MimeDescriptor
Gets the number of lines of text in a part of type TEXT when transfer encoded.

Specified by:
getLines in interface MessageResult.MimeDescriptor
Returns:
CRLF count when a TEXT type, otherwise -1

getMimeSubType

public java.lang.String getMimeSubType()
Description copied from interface: MessageResult.MimeDescriptor
Gets the MIME content subtype.

Specified by:
getMimeSubType in interface MessageResult.MimeDescriptor
Returns:
the MIME content subtype, or null if default

getMimeType

public java.lang.String getMimeType()
Description copied from interface: MessageResult.MimeDescriptor
Gets the top level MIME content media type.

Specified by:
getMimeType in interface MessageResult.MimeDescriptor
Returns:
top level MIME content media type, or null if default

getTransferContentEncoding

public java.lang.String getTransferContentEncoding()
Description copied from interface: MessageResult.MimeDescriptor
Gets the MIME content transfer encoding.

Specified by:
getTransferContentEncoding in interface MessageResult.MimeDescriptor
Returns:
MIME Content-Transfer-Encoding, possibly null

headers

public java.util.Iterator headers()
Description copied from interface: Headers
Gets headers for the message.

Specified by:
headers in interface Headers
Specified by:
headers in interface MessageResult.MimeDescriptor
Returns:
Header Iterator, or null if MessageResult.FetchGroup.HEADERS was not fetched

parts

public java.util.Iterator parts()
Description copied from interface: MessageResult.MimeDescriptor
Gets parts.

Specified by:
parts in interface MessageResult.MimeDescriptor
Returns:
MimeDescriptor Iterator when a composite top level MIME media type, null otherwise

getLanguages

public java.util.List getLanguages()
Description copied from interface: MessageResult.MimeDescriptor
Gets the languages, From the MIME Content-Language header value.

Specified by:
getLanguages in interface MessageResult.MimeDescriptor
Returns:
List of String names

getDisposition

public java.lang.String getDisposition()
Description copied from interface: MessageResult.MimeDescriptor
Gets MIME Content-Disposition.

Specified by:
getDisposition in interface MessageResult.MimeDescriptor
Returns:
Content-Disposition, or null if no disposition header exists

getDispositionParams

public java.util.Map getDispositionParams()
Description copied from interface: MessageResult.MimeDescriptor
Gets MIME Content-Disposition parameters.

Specified by:
getDispositionParams in interface MessageResult.MimeDescriptor
Returns:
Content-Disposition values indexed by names

getContentLocation

public java.lang.String getContentLocation()
Description copied from interface: MessageResult.MimeDescriptor
Gets MIME Content-Location header value.

Specified by:
getContentLocation in interface MessageResult.MimeDescriptor
Returns:
parsed MIME Content-Location, possibly null

getContentMD5

public java.lang.String getContentMD5()
Description copied from interface: MessageResult.MimeDescriptor
Gets MIME Content-MD5 header value.

Specified by:
getContentMD5 in interface MessageResult.MimeDescriptor
Returns:
parsed MIME Content-MD5, possibly null


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.