org.apache.james.mime4j.field
Class ContentDispositionField

java.lang.Object
  extended by org.apache.james.mime4j.field.AbstractField
      extended by org.apache.james.mime4j.field.ContentDispositionField
All Implemented Interfaces:
ParsedField, Field

public class ContentDispositionField
extends AbstractField

Represents a Content-Disposition field.


Field Summary
static java.lang.String DISPOSITION_TYPE_ATTACHMENT
          The attachment disposition type.
static java.lang.String DISPOSITION_TYPE_INLINE
          The inline disposition type.
static java.lang.String PARAM_CREATION_DATE
          The name of the creation-date parameter.
static java.lang.String PARAM_FILENAME
          The name of the filename parameter.
static java.lang.String PARAM_MODIFICATION_DATE
          The name of the modification-date parameter.
static java.lang.String PARAM_READ_DATE
          The name of the read-date parameter.
static java.lang.String PARAM_SIZE
          The name of the size parameter.
 
Method Summary
 java.util.Date getCreationDate()
          Gets the value of the creation-date parameter if set and valid.
 java.lang.String getDispositionType()
          Gets the disposition type defined in this Content-Disposition field.
 java.lang.String getFilename()
          Gets the value of the filename parameter if set.
 java.util.Date getModificationDate()
          Gets the value of the modification-date parameter if set and valid.
 java.lang.String getParameter(java.lang.String name)
          Gets the value of a parameter.
 java.util.Map<java.lang.String,java.lang.String> getParameters()
          Gets all parameters.
 ParseException getParseException()
          Gets the exception that was raised during parsing of the field value, if any; otherwise, null.
 java.util.Date getReadDate()
          Gets the value of the read-date parameter if set and valid.
 long getSize()
          Gets the value of the size parameter if set and valid.
 boolean isAttachment()
          Return true if the disposition type of this field is attachment, false otherwise.
 boolean isDispositionType(java.lang.String dispositionType)
          Determines if the disposition type of this field matches the given one.
 boolean isInline()
          Return true if the disposition type of this field is inline, false otherwise.
 
Methods inherited from class org.apache.james.mime4j.field.AbstractField
getBody, getName, getParser, getRaw, isValidField, parse, parse, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DISPOSITION_TYPE_INLINE

public static final java.lang.String DISPOSITION_TYPE_INLINE
The inline disposition type.

See Also:
Constant Field Values

DISPOSITION_TYPE_ATTACHMENT

public static final java.lang.String DISPOSITION_TYPE_ATTACHMENT
The attachment disposition type.

See Also:
Constant Field Values

PARAM_FILENAME

public static final java.lang.String PARAM_FILENAME
The name of the filename parameter.

See Also:
Constant Field Values

PARAM_CREATION_DATE

public static final java.lang.String PARAM_CREATION_DATE
The name of the creation-date parameter.

See Also:
Constant Field Values

PARAM_MODIFICATION_DATE

public static final java.lang.String PARAM_MODIFICATION_DATE
The name of the modification-date parameter.

See Also:
Constant Field Values

PARAM_READ_DATE

public static final java.lang.String PARAM_READ_DATE
The name of the read-date parameter.

See Also:
Constant Field Values

PARAM_SIZE

public static final java.lang.String PARAM_SIZE
The name of the size parameter.

See Also:
Constant Field Values
Method Detail

getParseException

public ParseException getParseException()
Gets the exception that was raised during parsing of the field value, if any; otherwise, null.

Specified by:
getParseException in interface ParsedField
Overrides:
getParseException in class AbstractField
Returns:
the exception that was thrown by the field parser or null if the field is valid.
See Also:
ParsedField.getParseException()

getDispositionType

public java.lang.String getDispositionType()
Gets the disposition type defined in this Content-Disposition field.

Returns:
the disposition type or an empty string if not set.

getParameter

public java.lang.String getParameter(java.lang.String name)
Gets the value of a parameter. Parameter names are case-insensitive.

Parameters:
name - the name of the parameter to get.
Returns:
the parameter value or null if not set.

getParameters

public java.util.Map<java.lang.String,java.lang.String> getParameters()
Gets all parameters.

Returns:
the parameters.

isDispositionType

public boolean isDispositionType(java.lang.String dispositionType)
Determines if the disposition type of this field matches the given one.

Parameters:
dispositionType - the disposition type to match against.
Returns:
true if the disposition type of this field matches, false otherwise.

isInline

public boolean isInline()
Return true if the disposition type of this field is inline, false otherwise.

Returns:
true if the disposition type of this field is inline, false otherwise.

isAttachment

public boolean isAttachment()
Return true if the disposition type of this field is attachment, false otherwise.

Returns:
true if the disposition type of this field is attachment, false otherwise.

getFilename

public java.lang.String getFilename()
Gets the value of the filename parameter if set.

Returns:
the filename parameter value or null if not set.

getCreationDate

public java.util.Date getCreationDate()
Gets the value of the creation-date parameter if set and valid.

Returns:
the creation-date parameter value or null if not set or invalid.

getModificationDate

public java.util.Date getModificationDate()
Gets the value of the modification-date parameter if set and valid.

Returns:
the modification-date parameter value or null if not set or invalid.

getReadDate

public java.util.Date getReadDate()
Gets the value of the read-date parameter if set and valid.

Returns:
the read-date parameter value or null if not set or invalid.

getSize

public long getSize()
Gets the value of the size parameter if set and valid.

Returns:
the size parameter value or -1 if not set or invalid.


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