Class ContentDispositionFieldImpl
java.lang.Object
org.apache.james.mime4j.field.AbstractField
org.apache.james.mime4j.field.ContentDispositionFieldImpl
- All Implemented Interfaces:
ContentDispositionField, ParsedField, Field
Represents a
Content-Disposition field.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Dateprivate booleanprivate Stringprivate Dateprivate booleanprivate booleanprivate ParseExceptionstatic final FieldParser<ContentDispositionField> private Dateprivate booleanFields inherited from class AbstractField
monitor, rawFieldFields inherited from interface ContentDispositionField
DISPOSITION_TYPE_ATTACHMENT, DISPOSITION_TYPE_INLINE, PARAM_CREATION_DATE, PARAM_FILENAME, PARAM_MODIFICATION_DATE, PARAM_READ_DATE, PARAM_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets 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 exception that was raised during parsing of the field value, if any; otherwise, null.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.private voidparse()private DateMethods inherited from class AbstractField
getBody, getName, getNameLowerCase, getRaw, getRawField, isValidField, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContentDispositionField
bodyDescriptionFieldMethods inherited from interface Field
getBody, getName, getNameLowerCase, getRawMethods inherited from interface ParsedField
isValidField
-
Field Details
-
parsed
private boolean parsed -
dispositionType
-
parameters
-
parseException
-
creationDateParsed
private boolean creationDateParsed -
creationDate
-
modificationDateParsed
private boolean modificationDateParsed -
modificationDate
-
readDateParsed
private boolean readDateParsed -
readDate
-
PARSER
-
-
Constructor Details
-
ContentDispositionFieldImpl
ContentDispositionFieldImpl(Field rawField, DecodeMonitor monitor)
-
-
Method Details
-
getParseException
Gets the exception that was raised during parsing of the field value, if any; otherwise, null.- Specified by:
getParseExceptionin interfaceParsedField- Overrides:
getParseExceptionin classAbstractField- Returns:
- the exception that was thrown by the field parser or
nullif the field is valid. - See Also:
-
getDispositionType
Description copied from interface:ContentDispositionFieldGets the disposition type defined in this Content-Disposition field.- Specified by:
getDispositionTypein interfaceContentDispositionField- Returns:
- the disposition type or an empty string if not set.
- See Also:
-
getParameter
Description copied from interface:ContentDispositionFieldGets the value of a parameter. Parameter names are case-insensitive.- Specified by:
getParameterin interfaceContentDispositionField- Parameters:
name- the name of the parameter to get.- Returns:
- the parameter value or
nullif not set. - See Also:
-
getParameters
Description copied from interface:ContentDispositionFieldGets all parameters.- Specified by:
getParametersin interfaceContentDispositionField- Returns:
- the parameters.
- See Also:
-
isDispositionType
Description copied from interface:ContentDispositionFieldDetermines if the disposition type of this field matches the given one.- Specified by:
isDispositionTypein interfaceContentDispositionField- Parameters:
dispositionType- the disposition type to match against.- Returns:
trueif the disposition type of this field matches,falseotherwise.- See Also:
-
isInline
public boolean isInline()Description copied from interface:ContentDispositionFieldReturntrueif the disposition type of this field is inline,falseotherwise.- Specified by:
isInlinein interfaceContentDispositionField- Returns:
trueif the disposition type of this field is inline,falseotherwise.- See Also:
-
isAttachment
public boolean isAttachment()Description copied from interface:ContentDispositionFieldReturntrueif the disposition type of this field is attachment,falseotherwise.- Specified by:
isAttachmentin interfaceContentDispositionField- Returns:
trueif the disposition type of this field is attachment,falseotherwise.- See Also:
-
getFilename
Description copied from interface:ContentDispositionFieldGets the value of thefilenameparameter if set.- Specified by:
getFilenamein interfaceContentDispositionField- Returns:
- the
filenameparameter value ornullif not set. - See Also:
-
getCreationDate
Description copied from interface:ContentDispositionFieldGets the value of thecreation-dateparameter if set and valid.- Specified by:
getCreationDatein interfaceContentDispositionField- Returns:
- the
creation-dateparameter value ornullif not set or invalid. - See Also:
-
getModificationDate
Description copied from interface:ContentDispositionFieldGets the value of themodification-dateparameter if set and valid.- Specified by:
getModificationDatein interfaceContentDispositionField- Returns:
- the
modification-dateparameter value ornullif not set or invalid. - See Also:
-
getReadDate
Description copied from interface:ContentDispositionFieldGets the value of theread-dateparameter if set and valid.- Specified by:
getReadDatein interfaceContentDispositionField- Returns:
- the
read-dateparameter value ornullif not set or invalid. - See Also:
-
getSize
public long getSize()Description copied from interface:ContentDispositionFieldGets the value of thesizeparameter if set and valid.- Specified by:
getSizein interfaceContentDispositionField- Returns:
- the
sizeparameter value or-1if not set or invalid. - See Also:
-
parseDate
-
parse
private void parse()
-