java.lang.Object
org.htmlunit.http.ContentDisposition
The result of parsing a
Content-Disposition header (RFC 6266, RFC 2183).
Parameter names are case-insensitive (stored lower case); if a parameter is defined more than once, the first one wins. The values are not sanitized.
- Author:
- Ronald Brill
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetExtendedParameter(String name) Returns the decoded value of an extended parameter (RFC 8187).Returns the file name suggested by the server.getParameter(String name) Returns the value of a plain parameter.Returns all plain parameters.getType()Returns the disposition type.booleanChecks the disposition type.booleanisInline()Checks the disposition type.
-
Method Details
-
getType
Returns the disposition type.- Returns:
- the disposition type in lower case (e.g.
attachmentorinline); an empty string if the header has none
-
isAttachment
public boolean isAttachment()Checks the disposition type.- Returns:
trueif the type isattachment
-
isInline
public boolean isInline()Checks the disposition type.- Returns:
trueif the type isinline
-
getParameter
Returns the value of a plain parameter.- Parameters:
name- the name of the parameter (case-insensitive), without a trailing*- Returns:
- the value of the plain parameter (quotes and escapes resolved) or
null; an empty string for a parameter without a value or with an empty value
-
getExtendedParameter
Returns the decoded value of an extended parameter (RFC 8187).- Parameters:
name- the name of the parameter (case-insensitive), without the trailing*- Returns:
- the decoded value of the extended parameter (
name*, RFC 8187) ornullif there is no such parameter or the value can not be decoded
-
getParameters
Returns all plain parameters.- Returns:
- the plain parameters (lower case names, in header order); not modifiable
-
getFilename
Returns the file name suggested by the server.- Returns:
- the file name; the extended parameter
filename*wins overfilename;nullif there is none. The name is returned as sent by the server, so it is not safe to use it as file name without checking.
-