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.String
DISPOSITION_TYPE_ATTACHMENT
Theattachment
disposition type.static java.lang.String
DISPOSITION_TYPE_INLINE
Theinline
disposition type.static java.lang.String
PARAM_CREATION_DATE
The name of thecreation-date
parameter.static java.lang.String
PARAM_FILENAME
The name of thefilename
parameter.static java.lang.String
PARAM_MODIFICATION_DATE
The name of themodification-date
parameter.static java.lang.String
PARAM_READ_DATE
The name of theread-date
parameter.static java.lang.String
PARAM_SIZE
The name of thesize
parameter.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
bodyDescriptionField()
java.util.Date
getCreationDate()
Gets the value of thecreation-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 thefilename
parameter if set.java.util.Date
getModificationDate()
Gets the value of themodification-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.java.util.Date
getReadDate()
Gets the value of theread-date
parameter if set and valid.long
getSize()
Gets the value of thesize
parameter if set and valid.boolean
isAttachment()
Returntrue
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()
Returntrue
if the disposition type of this field is inline,false
otherwise.-
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
Theinline
disposition type.- See Also:
- Constant Field Values
-
DISPOSITION_TYPE_ATTACHMENT
static final java.lang.String DISPOSITION_TYPE_ATTACHMENT
Theattachment
disposition type.- See Also:
- Constant Field Values
-
PARAM_FILENAME
static final java.lang.String PARAM_FILENAME
The name of thefilename
parameter.- See Also:
- Constant Field Values
-
PARAM_CREATION_DATE
static final java.lang.String PARAM_CREATION_DATE
The name of thecreation-date
parameter.- See Also:
- Constant Field Values
-
PARAM_MODIFICATION_DATE
static final java.lang.String PARAM_MODIFICATION_DATE
The name of themodification-date
parameter.- See Also:
- Constant Field Values
-
PARAM_READ_DATE
static final java.lang.String PARAM_READ_DATE
The name of theread-date
parameter.- See Also:
- Constant Field Values
-
PARAM_SIZE
static final java.lang.String PARAM_SIZE
The name of thesize
parameter.- See Also:
- Constant Field Values
-
-
Method Detail
-
bodyDescriptionField
default boolean bodyDescriptionField()
- Specified by:
bodyDescriptionField
in 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
null
if 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:
true
if the disposition type of this field matches,false
otherwise.
-
isInline
boolean isInline()
Returntrue
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
boolean isAttachment()
Returntrue
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
java.lang.String getFilename()
Gets the value of thefilename
parameter if set.- Returns:
- the
filename
parameter value ornull
if not set.
-
getCreationDate
java.util.Date getCreationDate()
Gets the value of thecreation-date
parameter if set and valid.- Returns:
- the
creation-date
parameter value ornull
if not set or invalid.
-
getModificationDate
java.util.Date getModificationDate()
Gets the value of themodification-date
parameter if set and valid.- Returns:
- the
modification-date
parameter value ornull
if not set or invalid.
-
getReadDate
java.util.Date getReadDate()
Gets the value of theread-date
parameter if set and valid.- Returns:
- the
read-date
parameter value ornull
if not set or invalid.
-
getSize
long getSize()
Gets the value of thesize
parameter if set and valid.- Returns:
- the
size
parameter value or-1
if not set or invalid.
-
-