Package org.apache.james.mime4j.field
Class ContentDispositionFieldLenientImpl
java.lang.Object
org.apache.james.mime4j.field.AbstractField
org.apache.james.mime4j.field.ContentDispositionFieldLenientImpl
- All Implemented Interfaces:
ContentDispositionField
,ParsedField
,Field
public class ContentDispositionFieldLenientImpl
extends AbstractField
implements ContentDispositionField
Represents a
Content-Disposition
field.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Date
private boolean
private static final DateTimeFormatter
private String
private final MimeParameterMapping
private Date
private boolean
private boolean
static final FieldParser
<ContentDispositionField> private Date
private boolean
Fields inherited from class org.apache.james.mime4j.field.AbstractField
monitor, rawField
Fields inherited from interface org.apache.james.mime4j.dom.field.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-date
parameter if set and valid.Gets the disposition type defined in this Content-Disposition field.Gets the value of thefilename
parameter if set.Gets the value of themodification-date
parameter if set and valid.getParameter
(String name) Gets the value of a parameter.Gets all parameters.Gets the value of theread-date
parameter if set and valid.long
getSize()
Gets the value of thesize
parameter if set and valid.boolean
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.private void
parse()
private Date
Methods inherited from class org.apache.james.mime4j.field.AbstractField
getBody, getName, getNameLowerCase, getParseException, getRaw, getRawField, isValidField, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.james.mime4j.dom.field.ContentDispositionField
bodyDescriptionField
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 Details
-
DEFAULT_DATE_FORMAT
-
parsed
private boolean parsed -
dispositionType
-
mapping
-
creationDateParsed
private boolean creationDateParsed -
creationDate
-
modificationDateParsed
private boolean modificationDateParsed -
modificationDate
-
readDateParsed
private boolean readDateParsed -
readDate
-
PARSER
-
-
Constructor Details
-
ContentDispositionFieldLenientImpl
ContentDispositionFieldLenientImpl(Field rawField, DecodeMonitor monitor)
-
-
Method Details
-
getDispositionType
Description copied from interface:ContentDispositionField
Gets the disposition type defined in this Content-Disposition field.- Specified by:
getDispositionType
in interfaceContentDispositionField
- Returns:
- the disposition type or an empty string if not set.
-
getParameter
Description copied from interface:ContentDispositionField
Gets the value of a parameter. Parameter names are case-insensitive.- Specified by:
getParameter
in interfaceContentDispositionField
- Parameters:
name
- the name of the parameter to get.- Returns:
- the parameter value or
null
if not set.
-
getParameters
Description copied from interface:ContentDispositionField
Gets all parameters.- Specified by:
getParameters
in interfaceContentDispositionField
- Returns:
- the parameters.
-
isDispositionType
Description copied from interface:ContentDispositionField
Determines if the disposition type of this field matches the given one.- Specified by:
isDispositionType
in interfaceContentDispositionField
- Parameters:
dispositionType
- the disposition type to match against.- Returns:
true
if the disposition type of this field matches,false
otherwise.
-
isInline
public boolean isInline()Description copied from interface:ContentDispositionField
Returntrue
if the disposition type of this field is inline,false
otherwise.- Specified by:
isInline
in interfaceContentDispositionField
- Returns:
true
if the disposition type of this field is inline,false
otherwise.
-
isAttachment
public boolean isAttachment()Description copied from interface:ContentDispositionField
Returntrue
if the disposition type of this field is attachment,false
otherwise.- Specified by:
isAttachment
in interfaceContentDispositionField
- Returns:
true
if the disposition type of this field is attachment,false
otherwise.
-
getFilename
Description copied from interface:ContentDispositionField
Gets the value of thefilename
parameter if set.- Specified by:
getFilename
in interfaceContentDispositionField
- Returns:
- the
filename
parameter value ornull
if not set.
-
getCreationDate
Description copied from interface:ContentDispositionField
Gets the value of thecreation-date
parameter if set and valid.- Specified by:
getCreationDate
in interfaceContentDispositionField
- Returns:
- the
creation-date
parameter value ornull
if not set or invalid.
-
getModificationDate
Description copied from interface:ContentDispositionField
Gets the value of themodification-date
parameter if set and valid.- Specified by:
getModificationDate
in interfaceContentDispositionField
- Returns:
- the
modification-date
parameter value ornull
if not set or invalid.
-
getReadDate
Description copied from interface:ContentDispositionField
Gets the value of theread-date
parameter if set and valid.- Specified by:
getReadDate
in interfaceContentDispositionField
- Returns:
- the
read-date
parameter value ornull
if not set or invalid.
-
getSize
public long getSize()Description copied from interface:ContentDispositionField
Gets the value of thesize
parameter if set and valid.- Specified by:
getSize
in interfaceContentDispositionField
- Returns:
- the
size
parameter value or-1
if not set or invalid.
-
parse
private void parse() -
parseDate
-