org.springframework.http

Class ContentDisposition

  • java.lang.Object
    • org.springframework.http.ContentDisposition


  • public final class ContentDisposition
    extends java.lang.Object
    Represent the Content-Disposition type and parameters as defined in RFC 2183.
    Since:
    5.0
    Author:
    Sebastien Deleuze, Juergen Hoeller
    See Also:
    RFC 2183
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static interface  ContentDisposition.Builder
      A mutable builder for ContentDisposition.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static ContentDisposition.Builder builder(java.lang.String type)
      Return a builder for a ContentDisposition.
      static ContentDisposition empty()
      Return an empty content disposition.
      boolean equals(java.lang.Object other) 
      java.nio.charset.Charset getCharset()
      Return the charset defined in filename* parameter, or null if not defined.
      java.time.ZonedDateTime getCreationDate()
      Return the value of the creation-date parameter, or null if not defined.
      java.lang.String getFilename()
      Return the value of the filename parameter (or the value of the filename* one decoded as defined in the RFC 5987), or null if not defined.
      java.time.ZonedDateTime getModificationDate()
      Return the value of the modification-date parameter, or null if not defined.
      java.lang.String getName()
      Return the value of the name parameter, or null if not defined.
      java.time.ZonedDateTime getReadDate()
      Return the value of the read-date parameter, or null if not defined.
      java.lang.Long getSize()
      Return the value of the size parameter, or null if not defined.
      java.lang.String getType()
      Return the disposition type, like for example inline, attachment, form-data, or null if not defined.
      int hashCode() 
      static ContentDisposition parse(java.lang.String contentDisposition)
      Parse a Content-Disposition header value as defined in RFC 2183.
      java.lang.String toString()
      Return the header value for this content disposition as defined in RFC 2183.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getType

        @Nullable
        public java.lang.String getType()
        Return the disposition type, like for example inline, attachment, form-data, or null if not defined.
      • getName

        @Nullable
        public java.lang.String getName()
        Return the value of the name parameter, or null if not defined.
      • getFilename

        @Nullable
        public java.lang.String getFilename()
        Return the value of the filename parameter (or the value of the filename* one decoded as defined in the RFC 5987), or null if not defined.
      • getCharset

        @Nullable
        public java.nio.charset.Charset getCharset()
        Return the charset defined in filename* parameter, or null if not defined.
      • getSize

        @Nullable
        public java.lang.Long getSize()
        Return the value of the size parameter, or null if not defined.
      • getCreationDate

        @Nullable
        public java.time.ZonedDateTime getCreationDate()
        Return the value of the creation-date parameter, or null if not defined.
      • getModificationDate

        @Nullable
        public java.time.ZonedDateTime getModificationDate()
        Return the value of the modification-date parameter, or null if not defined.
      • getReadDate

        @Nullable
        public java.time.ZonedDateTime getReadDate()
        Return the value of the read-date parameter, or null if not defined.
      • equals

        public boolean equals(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Return the header value for this content disposition as defined in RFC 2183.
        Overrides:
        toString in class java.lang.Object
        See Also:
        parse(String)
      • builder

        public static ContentDisposition.Builder builder(java.lang.String type)
        Return a builder for a ContentDisposition.
        Parameters:
        type - the disposition type like for example inline, attachment, or form-data
        Returns:
        the builder
      • parse

        public static ContentDisposition parse(java.lang.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()