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 java.lang.StringDISPOSITION_TYPE_ATTACHMENTTheattachmentdisposition type.static java.lang.StringDISPOSITION_TYPE_INLINETheinlinedisposition type.static java.lang.StringPARAM_CREATION_DATEThe name of thecreation-dateparameter.static java.lang.StringPARAM_FILENAMEThe name of thefilenameparameter.static java.lang.StringPARAM_MODIFICATION_DATEThe name of themodification-dateparameter.static java.lang.StringPARAM_READ_DATEThe name of theread-dateparameter.static java.lang.StringPARAM_SIZEThe name of thesizeparameter.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanbodyDescriptionField()java.util.DategetCreationDate()Gets the value of thecreation-dateparameter if set and valid.java.lang.StringgetDispositionType()Gets the disposition type defined in this Content-Disposition field.java.lang.StringgetFilename()Gets the value of thefilenameparameter if set.java.util.DategetModificationDate()Gets the value of themodification-dateparameter if set and valid.java.lang.StringgetParameter(java.lang.String name)Gets the value of a parameter.java.util.Map<java.lang.String,java.lang.String>getParameters()Gets all parameters.java.util.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(java.lang.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 java.lang.String DISPOSITION_TYPE_INLINE
Theinlinedisposition type.- See Also:
- Constant Field Values
-
DISPOSITION_TYPE_ATTACHMENT
static final java.lang.String DISPOSITION_TYPE_ATTACHMENT
Theattachmentdisposition type.- See Also:
- Constant Field Values
-
PARAM_FILENAME
static final java.lang.String PARAM_FILENAME
The name of thefilenameparameter.- See Also:
- Constant Field Values
-
PARAM_CREATION_DATE
static final java.lang.String PARAM_CREATION_DATE
The name of thecreation-dateparameter.- See Also:
- Constant Field Values
-
PARAM_MODIFICATION_DATE
static final java.lang.String PARAM_MODIFICATION_DATE
The name of themodification-dateparameter.- See Also:
- Constant Field Values
-
PARAM_READ_DATE
static final java.lang.String PARAM_READ_DATE
The name of theread-dateparameter.- See Also:
- Constant Field Values
-
PARAM_SIZE
static final java.lang.String PARAM_SIZE
The name of thesizeparameter.- See Also:
- Constant Field Values
-
-
Method Detail
-
bodyDescriptionField
default boolean bodyDescriptionField()
- Specified by:
bodyDescriptionFieldin interfaceParsedField
-
getDispositionType
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
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
nullif not set.
-
getParameters
java.util.Map<java.lang.String,java.lang.String> getParameters()
Gets all parameters.- Returns:
- the parameters.
-
isDispositionType
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:
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
java.lang.String getFilename()
Gets the value of thefilenameparameter if set.- Returns:
- the
filenameparameter value ornullif not set.
-
getCreationDate
java.util.Date getCreationDate()
Gets the value of thecreation-dateparameter if set and valid.- Returns:
- the
creation-dateparameter value ornullif not set or invalid.
-
getModificationDate
java.util.Date getModificationDate()
Gets the value of themodification-dateparameter if set and valid.- Returns:
- the
modification-dateparameter value ornullif not set or invalid.
-
getReadDate
java.util.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.
-
-