Interface ContentDispositionField
- All Superinterfaces:
Field, ParsedField
- All Known Implementing Classes:
ContentDispositionFieldImpl, ContentDispositionFieldLenientImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTheattachmentdisposition type.static final StringTheinlinedisposition type.static final StringThe name of thecreation-dateparameter.static final StringThe name of thefilenameparameter.static final StringThe name of themodification-dateparameter.static final StringThe name of theread-dateparameter.static final StringThe name of thesizeparameter. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanGets the value of thecreation-dateparameter if set and valid.Gets the disposition type defined in this Content-Disposition field.Gets the value of thefilenameparameter if set.Gets the value of themodification-dateparameter if set and valid.getParameter(String name) Gets the value of a parameter.Gets all parameters.Gets the value of theread-dateparameter if set and valid.longgetSize()Gets the value of thesizeparameter if set and valid.booleanReturntrueif 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 Field
getBody, getName, getNameLowerCase, getRawMethods inherited from interface ParsedField
getParseException, isValidField
-
Field Details
-
DISPOSITION_TYPE_INLINE
-
DISPOSITION_TYPE_ATTACHMENT
-
PARAM_FILENAME
-
PARAM_CREATION_DATE
-
PARAM_MODIFICATION_DATE
-
PARAM_READ_DATE
-
PARAM_SIZE
-
-
Method Details
-
bodyDescriptionField
default boolean bodyDescriptionField()- Specified by:
bodyDescriptionFieldin interfaceParsedField
-
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
-
getParameters
-
isDispositionType
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.
-