org.apache.james.mime4j.descriptor
Class MaximalBodyDescriptor

java.lang.Object
  extended by org.apache.james.mime4j.descriptor.DefaultBodyDescriptor
      extended by org.apache.james.mime4j.descriptor.MaximalBodyDescriptor
All Implemented Interfaces:
BodyDescriptor, ContentDescriptor, MutableBodyDescriptor

public class MaximalBodyDescriptor
extends DefaultBodyDescriptor

Parses and stores values for standard MIME header values.


Constructor Summary
protected MaximalBodyDescriptor()
           
  MaximalBodyDescriptor(BodyDescriptor parent)
           
 
Method Summary
 void addField(Field field)
          Should be called for each Content- header field of a MIME message or part.
 java.lang.String getContentDescription()
          Gets the value of the RFC Content-Description header.
 DateTime getContentDispositionCreationDate()
          Gets the creation-date parameter value of the content-disposition field.
 MimeException getContentDispositionCreationDateParseException()
          Gets any exception thrown during the parsing of getContentDispositionCreationDate()
 java.lang.String getContentDispositionFilename()
          Gets the filename parameter value of the content-disposition field.
 DateTime getContentDispositionModificationDate()
          Gets the modification-date parameter value of the content-disposition field.
 MimeException getContentDispositionModificationDateParseException()
          Gets any exception thrown during the parsing of getContentDispositionModificationDate()
 java.util.Map<java.lang.String,java.lang.String> getContentDispositionParameters()
          Gets the parameters of the content-disposition field.
 DateTime getContentDispositionReadDate()
          Gets the read-date parameter value of the content-disposition field.
 MimeException getContentDispositionReadDateParseException()
          Gets any exception thrown during the parsing of getContentDispositionReadDate()
 long getContentDispositionSize()
          Gets the size parameter value of the content-disposition field.
 MimeException getContentDispositionSizeParseException()
          Gets any exception thrown during the parsing of getContentDispositionSize()
 java.lang.String getContentDispositionType()
          Gets the disposition type of the content-disposition field.
 java.lang.String getContentId()
          Gets the value of the RFC Content-ID header.
 java.util.List<java.lang.String> getContentLanguage()
          Get the content-language header values.
 MimeException getContentLanguageParseException()
          Gets any exception thrown during the parsing of getContentLanguage()
 java.lang.String getContentLocation()
          Get the content-location header value.
 MimeException getContentLocationParseException()
          Gets any exception thrown during the parsing of getContentLocation()
 java.lang.String getContentMD5Raw()
          Gets the raw, Base64 encoded value of the Content-MD5 field.
 int getMimeMajorVersion()
          Gets the MIME major version as specified by the MIME-Version header.
 int getMimeMinorVersion()
          Gets the MIME minor version as specified by the MIME-Version header.
 MimeException getMimeVersionParseException()
          When the MIME version header exists but cannot be parsed this field will be contain the exception.
 
Methods inherited from class org.apache.james.mime4j.descriptor.DefaultBodyDescriptor
getBoundary, getCharset, getContentLength, getContentTypeParameters, getMediaType, getMimeType, getSubType, getTransferEncoding, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MaximalBodyDescriptor

protected MaximalBodyDescriptor()

MaximalBodyDescriptor

public MaximalBodyDescriptor(BodyDescriptor parent)
Method Detail

addField

public void addField(Field field)
Description copied from class: DefaultBodyDescriptor
Should be called for each Content- header field of a MIME message or part.

Specified by:
addField in interface MutableBodyDescriptor
Overrides:
addField in class DefaultBodyDescriptor
Parameters:
field - the MIME field.

getMimeMajorVersion

public int getMimeMajorVersion()
Gets the MIME major version as specified by the MIME-Version header. Defaults to one.

Returns:
positive integer

getMimeMinorVersion

public int getMimeMinorVersion()
Gets the MIME minor version as specified by the MIME-Version header. Defaults to zero.

Returns:
positive integer

getMimeVersionParseException

public MimeException getMimeVersionParseException()
When the MIME version header exists but cannot be parsed this field will be contain the exception.

Returns:
MimeException if the mime header cannot be parsed, null otherwise

getContentDescription

public java.lang.String getContentDescription()
Gets the value of the RFC Content-Description header.

Returns:
value of the Content-Description when present, null otherwise

getContentId

public java.lang.String getContentId()
Gets the value of the RFC Content-ID header.

Returns:
value of the Content-ID when present, null otherwise

getContentDispositionType

public java.lang.String getContentDispositionType()
Gets the disposition type of the content-disposition field. The value is case insensitive and will be converted to lower case. See RFC2183.

Returns:
content disposition type, or null when this has not been set

getContentDispositionParameters

public java.util.Map<java.lang.String,java.lang.String> getContentDispositionParameters()
Gets the parameters of the content-disposition field. See RFC2183.

Returns:
parameter value strings indexed by parameter name strings, not null

getContentDispositionFilename

public java.lang.String getContentDispositionFilename()
Gets the filename parameter value of the content-disposition field. See RFC2183.

Returns:
filename parameter value, or null when it is not present

getContentDispositionModificationDate

public DateTime getContentDispositionModificationDate()
Gets the modification-date parameter value of the content-disposition field. See RFC2183.

Returns:
modification-date parameter value, or null when this is not present

getContentDispositionModificationDateParseException

public MimeException getContentDispositionModificationDateParseException()
Gets any exception thrown during the parsing of getContentDispositionModificationDate()

Returns:
ParseException when the modification-date parse fails, null otherwise

getContentDispositionCreationDate

public DateTime getContentDispositionCreationDate()
Gets the creation-date parameter value of the content-disposition field. See RFC2183.

Returns:
creation-date parameter value, or null when this is not present

getContentDispositionCreationDateParseException

public MimeException getContentDispositionCreationDateParseException()
Gets any exception thrown during the parsing of getContentDispositionCreationDate()

Returns:
ParseException when the creation-date parse fails, null otherwise

getContentDispositionReadDate

public DateTime getContentDispositionReadDate()
Gets the read-date parameter value of the content-disposition field. See RFC2183.

Returns:
read-date parameter value, or null when this is not present

getContentDispositionReadDateParseException

public MimeException getContentDispositionReadDateParseException()
Gets any exception thrown during the parsing of getContentDispositionReadDate()

Returns:
ParseException when the read-date parse fails, null otherwise

getContentDispositionSize

public long getContentDispositionSize()
Gets the size parameter value of the content-disposition field. See RFC2183.

Returns:
size parameter value, or -1 if this size has not been set

getContentDispositionSizeParseException

public MimeException getContentDispositionSizeParseException()
Gets any exception thrown during the parsing of getContentDispositionSize()

Returns:
ParseException when the read-date parse fails, null otherwise

getContentLanguage

public java.util.List<java.lang.String> getContentLanguage()
Get the content-language header values. Each applicable language tag will be returned in order. See RFC4646 http://tools.ietf.org/html/rfc4646.

Returns:
list of language tag Strings, or null if no header exists

getContentLanguageParseException

public MimeException getContentLanguageParseException()
Gets any exception thrown during the parsing of getContentLanguage()

Returns:
ParseException when the content-language parse fails, null otherwise

getContentLocation

public java.lang.String getContentLocation()
Get the content-location header value. See RFC2557

Returns:
the URL content-location or null if no header exists

getContentLocationParseException

public MimeException getContentLocationParseException()
Gets any exception thrown during the parsing of getContentLocation()

Returns:
ParseException when the content-language parse fails, null otherwise

getContentMD5Raw

public java.lang.String getContentMD5Raw()
Gets the raw, Base64 encoded value of the Content-MD5 field. See RFC1864.

Returns:
raw encoded content-md5 or null if no header exists


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.