Package com.linecorp.armeria.common
Class ContentDisposition
java.lang.Object
com.linecorp.armeria.common.ContentDisposition
public final class ContentDisposition extends Object
Representation of the Content-Disposition type and parameters as defined in RFC 6266.
- See Also:
- RFC 6266
-
Method Summary
Modifier and Type Method Description String
asHeaderValue()
Returns the header value for this content disposition as defined in RFC 6266.static ContentDispositionBuilder
builder(String type)
Returns a newContentDispositionBuilder
with the specifiedtype
.Charset
charset()
Returns the charset defined infilename*
parameter, ornull
if not defined.boolean
equals(Object other)
String
filename()
Returns the value of thefilename
parameter (or the value of thefilename*
one decoded as defined in the RFC 5987), ornull
if not defined.int
hashCode()
String
name()
Returns the value of thename
parameter, ornull
if not defined.static ContentDisposition
of()
Returns an emptyContentDisposition
.static ContentDisposition
of(String type)
Returns a newContentDisposition
with the specifiedtype
.static ContentDisposition
of(String type, String name)
static ContentDisposition
of(String type, String name, String filename)
static ContentDisposition
parse(String contentDisposition)
Parses a"content-disposition"
header value as defined in RFC 2183.String
toString()
Returns the header value for this content disposition as defined in RFC 6266.String
type()
Returns the disposition type, like for exampleinline
,attachment
,form-data
.
-
Method Details
-
builder
Returns a newContentDispositionBuilder
with the specifiedtype
.- Parameters:
type
- the disposition type like for exampleinline
,attachment
, orform-data
-
of
Returns a newContentDisposition
with the specifiedtype
.- Parameters:
type
- the disposition type like for exampleinline
,attachment
, orform-data
-
of
- Parameters:
type
- the disposition type like for exampleinline
,attachment
, orform-data
name
- the name parameter
-
of
- Parameters:
type
- the disposition type like for exampleinline
,attachment
, orform-data
name
- the name parameterfilename
- the filename parameter that will be be formatted as quoted-string, as defined in RFC 2616, section 2.2, and any quote characters within the filename value will be escaped with a backslash, e.g."foo\"bar.txt"
becomes"foo\\\"bar.txt"
-
of
Returns an emptyContentDisposition
. -
parse
Parses a"content-disposition"
header value as defined in RFC 2183.Note that only the US-ASCII, UTF-8 and ISO-8859-1 charsets are supported. If other charsets are specified, ISO-8859-1 will be used instead.
- Parameters:
contentDisposition
- the"content-disposition"
header value- Returns:
- the parsed content disposition
- See Also:
asHeaderValue()
-
type
Returns the disposition type, like for exampleinline
,attachment
,form-data
. -
name
Returns the value of thename
parameter, ornull
if not defined. -
filename
Returns the value of thefilename
parameter (or the value of thefilename*
one decoded as defined in the RFC 5987), ornull
if not defined. -
charset
Returns the charset defined infilename*
parameter, ornull
if not defined. -
equals
-
hashCode
public int hashCode() -
asHeaderValue
Returns the header value for this content disposition as defined in RFC 6266.- See Also:
parse(String)
-
toString
Returns the header value for this content disposition as defined in RFC 6266.
-