Package org.springframework.http
Class ContentDisposition
- java.lang.Object
- org.springframework.http.ContentDisposition
public final class ContentDisposition extends Object
Represent the Content-Disposition type and parameters as defined in RFC 6266.- Since:
- 5.0
- Author:
- Sebastien Deleuze, Juergen Hoeller, Rossen Stoyanchev
- See Also:
- RFC 6266
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ContentDisposition.Builder
A mutable builder forContentDisposition
.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ContentDisposition.Builder
builder(String type)
Return a builder for aContentDisposition
.static ContentDisposition
empty()
Return an empty content disposition.boolean
equals(Object other)
Charset
getCharset()
Return the charset defined in filename* parameter, ornull
if not defined.ZonedDateTime
getCreationDate()
Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.String
getFilename()
Return the value of the filename parameter (or the value of the filename* one decoded as defined in the RFC 5987), ornull
if not defined.ZonedDateTime
getModificationDate()
Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.String
getName()
Return the value of the name parameter, ornull
if not defined.ZonedDateTime
getReadDate()
Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.Long
getSize()
Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.String
getType()
Return the disposition type, like for example inline, attachment, form-data, ornull
if not defined.int
hashCode()
static ContentDisposition
parse(String contentDisposition)
Parse a Content-Disposition header value as defined in RFC 2183.String
toString()
Return the header value for this content disposition as defined in RFC 6266.
Method Detail
getType
@Nullable public String getType()
Return the disposition type, like for example inline, attachment, form-data, ornull
if not defined.
getName
@Nullable public String getName()
Return the value of the name parameter, ornull
if not defined.
getFilename
@Nullable public String getFilename()
Return the value of the filename parameter (or the value of the filename* one decoded as defined in the RFC 5987), ornull
if not defined.
getCharset
@Nullable public Charset getCharset()
Return the charset defined in filename* parameter, ornull
if not defined.
getSize
@Deprecated @Nullable public Long getSize()
Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.Return the value of the size parameter, ornull
if not defined.
getCreationDate
@Deprecated @Nullable public ZonedDateTime getCreationDate()
Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.Return the value of the creation-date parameter, ornull
if not defined.
getModificationDate
@Deprecated @Nullable public ZonedDateTime getModificationDate()
Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.Return the value of the modification-date parameter, ornull
if not defined.
getReadDate
@Deprecated @Nullable public ZonedDateTime getReadDate()
Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.Return the value of the read-date parameter, ornull
if not defined.
toString
public String toString()
Return the header value for this content disposition as defined in RFC 6266.- Overrides:
toString
in classObject
- See Also:
parse(String)
builder
public static ContentDisposition.Builder builder(String type)
Return a builder for aContentDisposition
.- Parameters:
type
- the disposition type like for example inline, attachment, or form-data- Returns:
- the builder
empty
public static ContentDisposition empty()
Return an empty content disposition.
parse
public static ContentDisposition parse(String contentDisposition)
Parse a Content-Disposition header value as defined in RFC 2183.- Parameters:
contentDisposition
- the Content-Disposition header value- Returns:
- the parsed content disposition
- See Also:
toString()