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 interfaceContentDisposition.BuilderA mutable builder forContentDisposition.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ContentDisposition.Builderbuilder(String type)Return a builder for aContentDisposition.static ContentDispositionempty()Return an empty content disposition.booleanequals(Object other)CharsetgetCharset()Return the charset defined in filename* parameter, ornullif not defined.ZonedDateTimegetCreationDate()Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.StringgetFilename()Return the value of the filename parameter (or the value of the filename* one decoded as defined in the RFC 5987), ornullif not defined.ZonedDateTimegetModificationDate()Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.StringgetName()Return the value of the name parameter, ornullif not defined.ZonedDateTimegetReadDate()Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.LonggetSize()Deprecated.since 5.2.3 as per RFC 6266, Apendix B, to be removed in a future release.StringgetType()Return the disposition type, like for example inline, attachment, form-data, ornullif not defined.inthashCode()static ContentDispositionparse(String contentDisposition)Parse a Content-Disposition header value as defined in RFC 2183.StringtoString()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, ornullif not defined.
getName
@Nullable public String getName()
Return the value of the name parameter, ornullif 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), ornullif not defined.
getCharset
@Nullable public Charset getCharset()
Return the charset defined in filename* parameter, ornullif 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, ornullif 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, ornullif 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, ornullif 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, ornullif not defined.
toString
public String toString()
Return the header value for this content disposition as defined in RFC 6266.- Overrides:
toStringin 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()