Update ContentDisposition to RFC 6266

Close gh-24231
This commit is contained in:
Rossen Stoyanchev 2019-12-19 16:27:40 +00:00
parent 15321a3163
commit ea4f1ca5d5
1 changed files with 37 additions and 3 deletions

View File

@ -33,18 +33,20 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import static java.time.format.DateTimeFormatter.RFC_1123_DATE_TIME; import static java.time.format.DateTimeFormatter.RFC_1123_DATE_TIME;
/** /**
* Represent the Content-Disposition type and parameters as defined in RFC 2183. * Represent the Content-Disposition type and parameters as defined in RFC 6266.
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Rossen Stoyanchev
* @since 5.0 * @since 5.0
* @see <a href="https://tools.ietf.org/html/rfc2183">RFC 2183</a> * @see <a href="https://tools.ietf.org/html/rfc6266">RFC 6266</a>
*/ */
public final class ContentDisposition { public final class ContentDisposition {
private static final String INVALID_HEADER_FIELD_PARAMETER_FORMAT = private static final String INVALID_HEADER_FIELD_PARAMETER_FORMAT =
"Invalid header field parameter format (as defined in RFC 5987)"; "Invalid header field parameter format (as defined in RFC 5987)";
@Nullable @Nullable
private final String type; private final String type;
@ -124,7 +126,11 @@ public final class ContentDisposition {
/** /**
* Return the value of the {@literal size} parameter, or {@code null} if not defined. * Return the value of the {@literal size} parameter, or {@code null} if not defined.
* @deprecated since 5.2.3 as per
* <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
* to be removed in a future release.
*/ */
@Deprecated
@Nullable @Nullable
public Long getSize() { public Long getSize() {
return this.size; return this.size;
@ -132,7 +138,11 @@ public final class ContentDisposition {
/** /**
* Return the value of the {@literal creation-date} parameter, or {@code null} if not defined. * Return the value of the {@literal creation-date} parameter, or {@code null} if not defined.
* @deprecated since 5.2.3 as per
* <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
* to be removed in a future release.
*/ */
@Deprecated
@Nullable @Nullable
public ZonedDateTime getCreationDate() { public ZonedDateTime getCreationDate() {
return this.creationDate; return this.creationDate;
@ -140,7 +150,11 @@ public final class ContentDisposition {
/** /**
* Return the value of the {@literal modification-date} parameter, or {@code null} if not defined. * Return the value of the {@literal modification-date} parameter, or {@code null} if not defined.
* @deprecated since 5.2.3 as per
* <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
* to be removed in a future release.
*/ */
@Deprecated
@Nullable @Nullable
public ZonedDateTime getModificationDate() { public ZonedDateTime getModificationDate() {
return this.modificationDate; return this.modificationDate;
@ -148,7 +162,11 @@ public final class ContentDisposition {
/** /**
* Return the value of the {@literal read-date} parameter, or {@code null} if not defined. * Return the value of the {@literal read-date} parameter, or {@code null} if not defined.
* @deprecated since 5.2.3 as per
* <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
* to be removed in a future release.
*/ */
@Deprecated
@Nullable @Nullable
public ZonedDateTime getReadDate() { public ZonedDateTime getReadDate() {
return this.readDate; return this.readDate;
@ -188,7 +206,7 @@ public final class ContentDisposition {
} }
/** /**
* Return the header value for this content disposition as defined in RFC 2183. * Return the header value for this content disposition as defined in RFC 6266.
* @see #parse(String) * @see #parse(String)
*/ */
@Override @Override
@ -480,22 +498,38 @@ public final class ContentDisposition {
/** /**
* Set the value of the {@literal size} parameter. * Set the value of the {@literal size} parameter.
* @deprecated since 5.2.3 as per
* <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
* to be removed in a future release.
*/ */
@Deprecated
Builder size(Long size); Builder size(Long size);
/** /**
* Set the value of the {@literal creation-date} parameter. * Set the value of the {@literal creation-date} parameter.
* @deprecated since 5.2.3 as per
* <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
* to be removed in a future release.
*/ */
@Deprecated
Builder creationDate(ZonedDateTime creationDate); Builder creationDate(ZonedDateTime creationDate);
/** /**
* Set the value of the {@literal modification-date} parameter. * Set the value of the {@literal modification-date} parameter.
* @deprecated since 5.2.3 as per
* <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
* to be removed in a future release.
*/ */
@Deprecated
Builder modificationDate(ZonedDateTime modificationDate); Builder modificationDate(ZonedDateTime modificationDate);
/** /**
* Set the value of the {@literal read-date} parameter. * Set the value of the {@literal read-date} parameter.
* @deprecated since 5.2.3 as per
* <a href="https://tools.ietf.org/html/rfc6266#appendix-B">RFC 6266, Apendix B</a>,
* to be removed in a future release.
*/ */
@Deprecated
Builder readDate(ZonedDateTime readDate); Builder readDate(ZonedDateTime readDate);
/** /**