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, RFC1864ContentMD5Descriptor, RFC2045MimeDescriptor, RFC2183ContentDispositionDescriptor, RFC2557ContentLocationDescriptor, RFC3066ContentLanguageDescriptor

public class MaximalBodyDescriptor
extends DefaultBodyDescriptor
implements RFC2045MimeDescriptor, RFC2183ContentDispositionDescriptor, RFC3066ContentLanguageDescriptor, RFC2557ContentLocationDescriptor, RFC1864ContentMD5Descriptor

Parses and stores values for standard MIME header values.


Constructor Summary
protected MaximalBodyDescriptor()
           
  MaximalBodyDescriptor(BodyDescriptor parent)
           
 
Method Summary
 void addField(java.lang.String name, java.lang.String value)
          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 #getContentCreationModificationDate()
 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 RFC2183ContentDispositionDescriptor.getContentDispositionModificationDate()
 java.util.Map 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 #getContentReadModificationDate()
 long getContentDispositionSize()
          Gets the size parameter value of the content-disposition field.
 MimeException getContentDispositionSizeParseException()
          Gets any exception thrown during the parsing of #getContentReadModificationDate()
 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 getContentLanguage()
          Get the content-language header values.
 MimeException getContentLanguageParseException()
          Gets any exception thrown during the parsing of RFC3066ContentLanguageDescriptor.getContentLanguage()
 java.lang.String getContentLocation()
          Get the content-location header value.
 MimeException getContentLocationParseException()
          Gets any exception thrown during the parsing of #getContentLanguage()
 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
 
Methods inherited from interface org.apache.james.mime4j.descriptor.ContentDescriptor
getCharset, getContentLength, getContentTypeParameters, getMediaType, getMimeType, getSubType, getTransferEncoding
 

Constructor Detail

MaximalBodyDescriptor

protected MaximalBodyDescriptor()

MaximalBodyDescriptor

public MaximalBodyDescriptor(BodyDescriptor parent)
Method Detail

addField

public void addField(java.lang.String name,
                     java.lang.String value)
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:
name - the field name.
value - the field value.

getMimeMajorVersion

public int getMimeMajorVersion()
Description copied from interface: RFC2045MimeDescriptor
Gets the MIME major version as specified by the MIME-Version header. Defaults to one.

Specified by:
getMimeMajorVersion in interface RFC2045MimeDescriptor
Returns:
positive integer
See Also:
RFC2045MimeDescriptor.getMimeMajorVersion()

getMimeMinorVersion

public int getMimeMinorVersion()
Description copied from interface: RFC2045MimeDescriptor
Gets the MIME minor version as specified by the MIME-Version header. Defaults to zero.

Specified by:
getMimeMinorVersion in interface RFC2045MimeDescriptor
Returns:
positive integer
See Also:
RFC2045MimeDescriptor.getMimeMinorVersion()

getMimeVersionParseException

public MimeException getMimeVersionParseException()
Description copied from interface: RFC2045MimeDescriptor
When the MIME version header exists but cannot be parsed this field will be contain the exception.

Specified by:
getMimeVersionParseException in interface RFC2045MimeDescriptor
Returns:
MimeException if the mime header cannot be parsed, null otherwise
See Also:
RFC2045MimeDescriptor.getMimeVersionParseException()

getContentDescription

public java.lang.String getContentDescription()
Description copied from interface: RFC2045MimeDescriptor
Gets the value of the RFC Content-Description header.

Specified by:
getContentDescription in interface RFC2045MimeDescriptor
Returns:
value of the Content-Description when present, null otherwise
See Also:
RFC2045MimeDescriptor.getContentDescription()

getContentId

public java.lang.String getContentId()
Description copied from interface: RFC2045MimeDescriptor
Gets the value of the RFC Content-ID header.

Specified by:
getContentId in interface RFC2045MimeDescriptor
Returns:
value of the Content-ID when present, null otherwise
See Also:
RFC2045MimeDescriptor.getContentId()

getContentDispositionType

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

Specified by:
getContentDispositionType in interface RFC2183ContentDispositionDescriptor
Returns:
content disposition type, or null when this has not been set
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionType()

getContentDispositionParameters

public java.util.Map getContentDispositionParameters()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets the parameters of the content-disposition field. See RFC2183.

Specified by:
getContentDispositionParameters in interface RFC2183ContentDispositionDescriptor
Returns:
parameter value strings indexed by parameter name strings, not null
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionParameters()

getContentDispositionFilename

public java.lang.String getContentDispositionFilename()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets the filename parameter value of the content-disposition field. See RFC2183.

Specified by:
getContentDispositionFilename in interface RFC2183ContentDispositionDescriptor
Returns:
filename parameter value, or null when it is not present
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionFilename()

getContentDispositionModificationDate

public DateTime getContentDispositionModificationDate()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets the modification-date parameter value of the content-disposition field. See RFC2183.

Specified by:
getContentDispositionModificationDate in interface RFC2183ContentDispositionDescriptor
Returns:
modification-date parameter value, or null when this is not present
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionModificationDate()

getContentDispositionModificationDateParseException

public MimeException getContentDispositionModificationDateParseException()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets any exception thrown during the parsing of RFC2183ContentDispositionDescriptor.getContentDispositionModificationDate()

Specified by:
getContentDispositionModificationDateParseException in interface RFC2183ContentDispositionDescriptor
Returns:
ParseException when the modification-date parse fails, null otherwise
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionModificationDateParseException()

getContentDispositionCreationDate

public DateTime getContentDispositionCreationDate()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets the creation-date parameter value of the content-disposition field. See RFC2183.

Specified by:
getContentDispositionCreationDate in interface RFC2183ContentDispositionDescriptor
Returns:
creation-date parameter value, or null when this is not present
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionCreationDate()

getContentDispositionCreationDateParseException

public MimeException getContentDispositionCreationDateParseException()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets any exception thrown during the parsing of #getContentCreationModificationDate()

Specified by:
getContentDispositionCreationDateParseException in interface RFC2183ContentDispositionDescriptor
Returns:
ParseException when the creation-date parse fails, null otherwise
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionCreationDateParseException()

getContentDispositionReadDate

public DateTime getContentDispositionReadDate()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets the read-date parameter value of the content-disposition field. See RFC2183.

Specified by:
getContentDispositionReadDate in interface RFC2183ContentDispositionDescriptor
Returns:
read-date parameter value, or null when this is not present
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionReadDate()

getContentDispositionReadDateParseException

public MimeException getContentDispositionReadDateParseException()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets any exception thrown during the parsing of #getContentReadModificationDate()

Specified by:
getContentDispositionReadDateParseException in interface RFC2183ContentDispositionDescriptor
Returns:
ParseException when the read-date parse fails, null otherwise
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionReadDateParseException()

getContentDispositionSize

public long getContentDispositionSize()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets the size parameter value of the content-disposition field. See RFC2183.

Specified by:
getContentDispositionSize in interface RFC2183ContentDispositionDescriptor
Returns:
size parameter value, or -1 if this size has not been set
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionSize()

getContentDispositionSizeParseException

public MimeException getContentDispositionSizeParseException()
Description copied from interface: RFC2183ContentDispositionDescriptor
Gets any exception thrown during the parsing of #getContentReadModificationDate()

Specified by:
getContentDispositionSizeParseException in interface RFC2183ContentDispositionDescriptor
Returns:
ParseException when the read-date parse fails, null otherwise
See Also:
RFC2183ContentDispositionDescriptor.getContentDispositionSizeParseException()

getContentLanguage

public java.util.List getContentLanguage()
Description copied from interface: RFC3066ContentLanguageDescriptor
Get the content-language header values. Each applicable language tag will be returned in order. See RFC4646 http://tools.ietf.org/html/rfc4646.

Specified by:
getContentLanguage in interface RFC3066ContentLanguageDescriptor
Returns:
list of language tag Strings, or null if no header exists
See Also:
RFC3066ContentLanguageDescriptor.getContentLanguage()

getContentLanguageParseException

public MimeException getContentLanguageParseException()
Description copied from interface: RFC3066ContentLanguageDescriptor
Gets any exception thrown during the parsing of RFC3066ContentLanguageDescriptor.getContentLanguage()

Specified by:
getContentLanguageParseException in interface RFC3066ContentLanguageDescriptor
Returns:
ParseException when the content-language parse fails, null otherwise
See Also:
RFC3066ContentLanguageDescriptor.getContentLanguageParseException()

getContentLocation

public java.lang.String getContentLocation()
Description copied from interface: RFC2557ContentLocationDescriptor
Get the content-location header value. See RFC2557

Specified by:
getContentLocation in interface RFC2557ContentLocationDescriptor
Returns:
the URL content-location or null if no header exists
See Also:
RFC2557ContentLocationDescriptor.getContentLocation()

getContentLocationParseException

public MimeException getContentLocationParseException()
Description copied from interface: RFC2557ContentLocationDescriptor
Gets any exception thrown during the parsing of #getContentLanguage()

Specified by:
getContentLocationParseException in interface RFC2557ContentLocationDescriptor
Returns:
ParseException when the content-language parse fails, null otherwise
See Also:
RFC2557ContentLocationDescriptor.getContentLocationParseException()

getContentMD5Raw

public java.lang.String getContentMD5Raw()
Description copied from interface: RFC1864ContentMD5Descriptor
Gets the raw, Base64 encoded value of the Content-MD5 field. See RFC1864.

Specified by:
getContentMD5Raw in interface RFC1864ContentMD5Descriptor
Returns:
raw encoded content-md5 or null if no header exists
See Also:
RFC1864ContentMD5Descriptor.getContentMD5Raw()


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