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 String
DISPOSITION_TYPE_ATTACHMENT
Theattachment
disposition type.static String
DISPOSITION_TYPE_INLINE
Theinline
disposition type.static String
PARAM_CREATION_DATE
The name of thecreation-date
parameter.static String
PARAM_FILENAME
The name of thefilename
parameter.static String
PARAM_MODIFICATION_DATE
The name of themodification-date
parameter.static String
PARAM_READ_DATE
The name of theread-date
parameter.static String
PARAM_SIZE
The name of thesize
parameter.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Date
getCreationDate()
Gets the value of thecreation-date
parameter if set and valid.String
getDispositionType()
Gets the disposition type defined in this Content-Disposition field.String
getFilename()
Gets the value of thefilename
parameter if set.Date
getModificationDate()
Gets the value of themodification-date
parameter if set and valid.String
getParameter(String name)
Gets the value of a parameter.Map<String,String>
getParameters()
Gets all parameters.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(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 String DISPOSITION_TYPE_INLINE
Theinline
disposition type.- See Also:
- Constant Field Values
-
DISPOSITION_TYPE_ATTACHMENT
static final String DISPOSITION_TYPE_ATTACHMENT
Theattachment
disposition type.- See Also:
- Constant Field Values
-
PARAM_FILENAME
static final String PARAM_FILENAME
The name of thefilename
parameter.- See Also:
- Constant Field Values
-
PARAM_CREATION_DATE
static final String PARAM_CREATION_DATE
The name of thecreation-date
parameter.- See Also:
- Constant Field Values
-
PARAM_MODIFICATION_DATE
static final String PARAM_MODIFICATION_DATE
The name of themodification-date
parameter.- See Also:
- Constant Field Values
-
PARAM_READ_DATE
static final String PARAM_READ_DATE
The name of theread-date
parameter.- See Also:
- Constant Field Values
-
PARAM_SIZE
static final String PARAM_SIZE
The name of thesize
parameter.- 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
null
if 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:
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
String getFilename()
Gets the value of thefilename
parameter if set.- Returns:
- the
filename
parameter value ornull
if not set.
-
getCreationDate
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
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
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.
-
-