Package org.springframework.http
Class ContentDisposition
java.lang.Object
org.springframework.http.ContentDisposition
Representation of the Content-Disposition type and parameters as defined in RFC 6266.
- Since:
- 5.0
- Author:
- Sebastien Deleuze, Juergen Hoeller, Rossen Stoyanchev, Sergey Tsypanov
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A mutable builder forContentDisposition
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContentDisposition.Builder
Return a builder for aContentDisposition
of type "attachment".static ContentDisposition.Builder
Return a builder for aContentDisposition
.static ContentDisposition
empty()
Return an empty content disposition.boolean
static ContentDisposition.Builder
formData()
Return a builder for aContentDisposition
of type "form-data".Return the charset defined in filename* parameter, ornull
if not defined.Deprecated.since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.Return the value of the filename parameter, possibly decoded from BASE64 encoding based on RFC 2047, or of the filename* parameter, possibly decoded as defined in the RFC 5987.Deprecated.since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.getName()
Return the value of the name parameter, ornull
if not defined.Deprecated.since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.getSize()
Deprecated.since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.getType()
Return the disposition type.int
hashCode()
static ContentDisposition.Builder
inline()
Return a builder for aContentDisposition
of type "inline".boolean
Return whether thetype
is "attachment".boolean
Return whether thetype
is "form-data".boolean
isInline()
Return whether thetype
is "inline".static ContentDisposition
Parse a Content-Disposition header value as defined in RFC 2183.toString()
Return the header value for this content disposition as defined in RFC 6266.
-
Method Details
-
isAttachment
public boolean isAttachment()Return whether thetype
is "attachment".- Since:
- 5.3
-
isFormData
public boolean isFormData()Return whether thetype
is "form-data".- Since:
- 5.3
-
isInline
public boolean isInline()Return whether thetype
is "inline".- Since:
- 5.3
-
getType
Return the disposition type.- See Also:
-
getName
Return the value of the name parameter, ornull
if not defined. -
getFilename
Return the value of the filename parameter, possibly decoded from BASE64 encoding based on RFC 2047, or of the filename* parameter, possibly decoded as defined in the RFC 5987. -
getCharset
Return the charset defined in filename* parameter, ornull
if not defined. -
getSize
Deprecated.since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.Return the value of the size parameter, ornull
if not defined. -
getCreationDate
Deprecated.since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.Return the value of the creation-date parameter, ornull
if not defined. -
getModificationDate
Deprecated.since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.Return the value of the modification-date parameter, ornull
if not defined. -
getReadDate
Deprecated.since 5.2.3 as per RFC 6266, Appendix B, to be removed in a future release.Return the value of the read-date parameter, ornull
if not defined. -
equals
-
hashCode
public int hashCode() -
toString
Return the header value for this content disposition as defined in RFC 6266. -
attachment
Return a builder for aContentDisposition
of type "attachment".- Since:
- 5.3
-
formData
Return a builder for aContentDisposition
of type "form-data".- Since:
- 5.3
-
inline
Return a builder for aContentDisposition
of type "inline".- Since:
- 5.3
-
builder
Return a builder for aContentDisposition
.- Parameters:
type
- the disposition type like for example inline, attachment, or form-data- Returns:
- the builder
-
empty
Return an empty content disposition. -
parse
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:
-