Interface ContentDispositionField
-
- All Superinterfaces:
Field,ParsedField
- All Known Implementing Classes:
ContentDispositionFieldImpl,ContentDispositionFieldLenientImpl
public interface ContentDispositionField extends ParsedField
-
-
Field Summary
Fields Modifier and Type Field Description static StringDISPOSITION_TYPE_ATTACHMENTTheattachmentdisposition type.static StringDISPOSITION_TYPE_INLINETheinlinedisposition type.static StringPARAM_CREATION_DATEThe name of thecreation-dateparameter.static StringPARAM_FILENAMEThe name of thefilenameparameter.static StringPARAM_MODIFICATION_DATEThe name of themodification-dateparameter.static StringPARAM_READ_DATEThe name of theread-dateparameter.static StringPARAM_SIZEThe name of thesizeparameter.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DategetCreationDate()Gets the value of thecreation-dateparameter if set and valid.StringgetDispositionType()Gets the disposition type defined in this Content-Disposition field.StringgetFilename()Gets the value of thefilenameparameter if set.DategetModificationDate()Gets the value of themodification-dateparameter if set and valid.StringgetParameter(String name)Gets the value of a parameter.Map<String,String>getParameters()Gets all parameters.DategetReadDate()Gets the value of theread-dateparameter if set and valid.longgetSize()Gets the value of thesizeparameter if set and valid.booleanisAttachment()Returntrueif the disposition type of this field is attachment,falseotherwise.booleanisDispositionType(String dispositionType)Determines if the disposition type of this field matches the given one.booleanisInline()Returntrueif the disposition type of this field is inline,falseotherwise.-
Methods inherited from interface org.apache.james.mime4j.stream.Field
getBody, getName, getNameLowerCase, getRaw
-
Methods inherited from interface org.apache.james.mime4j.dom.field.ParsedField
getParseException, isValidField
-
-
-
-
Field Detail
-
DISPOSITION_TYPE_INLINE
static final String DISPOSITION_TYPE_INLINE
Theinlinedisposition type.- See Also:
- Constant Field Values
-
DISPOSITION_TYPE_ATTACHMENT
static final String DISPOSITION_TYPE_ATTACHMENT
Theattachmentdisposition type.- See Also:
- Constant Field Values
-
PARAM_FILENAME
static final String PARAM_FILENAME
The name of thefilenameparameter.- See Also:
- Constant Field Values
-
PARAM_CREATION_DATE
static final String PARAM_CREATION_DATE
The name of thecreation-dateparameter.- See Also:
- Constant Field Values
-
PARAM_MODIFICATION_DATE
static final String PARAM_MODIFICATION_DATE
The name of themodification-dateparameter.- See Also:
- Constant Field Values
-
PARAM_READ_DATE
static final String PARAM_READ_DATE
The name of theread-dateparameter.- See Also:
- Constant Field Values
-
PARAM_SIZE
static final String PARAM_SIZE
The name of thesizeparameter.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDispositionType
String getDispositionType()
Gets the disposition type defined in this Content-Disposition field.- Returns:
- the disposition type or an empty string if not set.
-
getParameter
String getParameter(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
nullif not set.
-
isDispositionType
boolean isDispositionType(String dispositionType)
Determines if the disposition type of this field matches the given one.- Parameters:
dispositionType- the disposition type to match against.- Returns:
trueif the disposition type of this field matches,falseotherwise.
-
isInline
boolean isInline()
Returntrueif the disposition type of this field is inline,falseotherwise.- Returns:
trueif the disposition type of this field is inline,falseotherwise.
-
isAttachment
boolean isAttachment()
Returntrueif the disposition type of this field is attachment,falseotherwise.- Returns:
trueif the disposition type of this field is attachment,falseotherwise.
-
getFilename
String getFilename()
Gets the value of thefilenameparameter if set.- Returns:
- the
filenameparameter value ornullif not set.
-
getCreationDate
Date getCreationDate()
Gets the value of thecreation-dateparameter if set and valid.- Returns:
- the
creation-dateparameter value ornullif not set or invalid.
-
getModificationDate
Date getModificationDate()
Gets the value of themodification-dateparameter if set and valid.- Returns:
- the
modification-dateparameter value ornullif not set or invalid.
-
getReadDate
Date getReadDate()
Gets the value of theread-dateparameter if set and valid.- Returns:
- the
read-dateparameter value ornullif not set or invalid.
-
getSize
long getSize()
Gets the value of thesizeparameter if set and valid.- Returns:
- the
sizeparameter value or-1if not set or invalid.
-
-