javax.mail.internet
Class ContentDisposition
java.lang.Object
javax.mail.internet.ContentDisposition
public class ContentDisposition
extends java.lang.Object
This class represents a MIME Content-Disposition value.
It provides methods to parse a Content-Disposition string into
individual components and to generate a MIME style Content-Disposition
string.
ContentDisposition
public ContentDisposition()
No-arg constructor.
ContentDisposition
public ContentDisposition(String s)
throws ParseException
Constructor that takes a ContentDisposition string.
The String is parsed into its constituents: disposition and parameters.
A ParseException is thrown if the parse fails.
s
- the ContentDisposition string.
ParseException
- if the parse fails.
ContentDisposition
public ContentDisposition(String disposition,
ParameterList list)
Constructor.
disposition
- dispositionlist
- ParameterList
getDisposition
public String getDisposition()
Return the disposition value.
- the disposition
getParameter
public String getParameter(String name)
Return the specified parameter value.
Returns null if this parameter is absent.
name
- the name of the parameter
- the parameter value
getParameterList
public ParameterList getParameterList()
Return a ParameterList object that holds all the available parameters.
Returns null if no parameters are available.
setDisposition
public void setDisposition(String disposition)
Set the primary type. Overrides existing primary type.
setParameter
public void setParameter(String name,
String value)
Set the specified parameter.
If this parameter already exists, it is replaced by this new value.
name
- the parameter namevalue
- the parameter value
setParameterList
public void setParameterList(ParameterList list)
Set a new ParameterList.
list
- the ParameterList
toString
public String toString()
Retrieve a RFC2045 style string representation of this
ContentDisposition.
Returns null if the conversion failed.
- RFC2045 style string