org.apache.james.mime4j.field
Class ContentDispositionFieldImpl

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

public class ContentDispositionFieldImpl
extends AbstractField
implements ContentDispositionField

Represents a Content-Disposition field.


Field Summary
static FieldParser<ContentDispositionField> PARSER
           
 
Fields inherited from class org.apache.james.mime4j.field.AbstractField
monitor, rawField
 
Fields inherited from interface org.apache.james.mime4j.dom.field.ContentDispositionField
DISPOSITION_TYPE_ATTACHMENT, DISPOSITION_TYPE_INLINE, PARAM_CREATION_DATE, PARAM_FILENAME, PARAM_MODIFICATION_DATE, PARAM_READ_DATE, PARAM_SIZE
 
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.
 org.apache.james.mime4j.field.contentdisposition.parser.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, getRaw, getRawField, isValidField, 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.dom.field.ParsedField
isValidField
 
Methods inherited from interface org.apache.james.mime4j.stream.Field
getBody, getName, getRaw
 

Field Detail

PARSER

public static final FieldParser<ContentDispositionField> PARSER
Method Detail

getParseException

public org.apache.james.mime4j.field.contentdisposition.parser.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()
Description copied from interface: ContentDispositionField
Gets the disposition type defined in this Content-Disposition field.

Specified by:
getDispositionType in interface ContentDispositionField
Returns:
the disposition type or an empty string if not set.
See Also:
ContentDispositionField.getDispositionType()

getParameter

public java.lang.String getParameter(java.lang.String name)
Description copied from interface: ContentDispositionField
Gets the value of a parameter. Parameter names are case-insensitive.

Specified by:
getParameter in interface ContentDispositionField
Parameters:
name - the name of the parameter to get.
Returns:
the parameter value or null if not set.
See Also:
ContentDispositionField.getParameter(java.lang.String)

getParameters

public java.util.Map<java.lang.String,java.lang.String> getParameters()
Description copied from interface: ContentDispositionField
Gets all parameters.

Specified by:
getParameters in interface ContentDispositionField
Returns:
the parameters.
See Also:
ContentDispositionField.getParameters()

isDispositionType

public boolean isDispositionType(java.lang.String dispositionType)
Description copied from interface: ContentDispositionField
Determines if the disposition type of this field matches the given one.

Specified by:
isDispositionType in interface ContentDispositionField
Parameters:
dispositionType - the disposition type to match against.
Returns:
true if the disposition type of this field matches, false otherwise.
See Also:
ContentDispositionField.isDispositionType(java.lang.String)

isInline

public boolean isInline()
Description copied from interface: ContentDispositionField
Return true if the disposition type of this field is inline, false otherwise.

Specified by:
isInline in interface ContentDispositionField
Returns:
true if the disposition type of this field is inline, false otherwise.
See Also:
ContentDispositionField.isInline()

isAttachment

public boolean isAttachment()
Description copied from interface: ContentDispositionField
Return true if the disposition type of this field is attachment, false otherwise.

Specified by:
isAttachment in interface ContentDispositionField
Returns:
true if the disposition type of this field is attachment, false otherwise.
See Also:
ContentDispositionField.isAttachment()

getFilename

public java.lang.String getFilename()
Description copied from interface: ContentDispositionField
Gets the value of the filename parameter if set.

Specified by:
getFilename in interface ContentDispositionField
Returns:
the filename parameter value or null if not set.
See Also:
ContentDispositionField.getFilename()

getCreationDate

public java.util.Date getCreationDate()
Description copied from interface: ContentDispositionField
Gets the value of the creation-date parameter if set and valid.

Specified by:
getCreationDate in interface ContentDispositionField
Returns:
the creation-date parameter value or null if not set or invalid.
See Also:
ContentDispositionField.getCreationDate()

getModificationDate

public java.util.Date getModificationDate()
Description copied from interface: ContentDispositionField
Gets the value of the modification-date parameter if set and valid.

Specified by:
getModificationDate in interface ContentDispositionField
Returns:
the modification-date parameter value or null if not set or invalid.
See Also:
ContentDispositionField.getModificationDate()

getReadDate

public java.util.Date getReadDate()
Description copied from interface: ContentDispositionField
Gets the value of the read-date parameter if set and valid.

Specified by:
getReadDate in interface ContentDispositionField
Returns:
the read-date parameter value or null if not set or invalid.
See Also:
ContentDispositionField.getReadDate()

getSize

public long getSize()
Description copied from interface: ContentDispositionField
Gets the value of the size parameter if set and valid.

Specified by:
getSize in interface ContentDispositionField
Returns:
the size parameter value or -1 if not set or invalid.
See Also:
ContentDispositionField.getSize()


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