Class ContentDisposition

java.lang.Object
io.helidon.common.http.ContentDisposition
All Implemented Interfaces:
Http.HeaderValue

public class ContentDisposition extends Object implements Http.HeaderValue
A generic representation of the Content-Disposition header.

Parameter encoding is not supported, other than URI percent encoding in the filename parameter. See URLDecoder.

See also:
  • Method Details

    • builder

      public static ContentDisposition.Builder builder()
      A new builder to set up content disposition.
      Returns:
      builder
    • parse

      public static ContentDisposition parse(String headerValue)
      Parse a received header value.
      Parameters:
      headerValue - content disposition header value
      Returns:
      a parsed content disposition
    • empty

      public static ContentDisposition empty()
      An empty content disposition.
      Returns:
      empty disposition with empty type
    • name

      public String name()
      Description copied from interface: Http.HeaderValue
      Name of the header as configured by user or as received on the wire.
      Specified by:
      name in interface Http.HeaderValue
      Returns:
      header name, always lower case for HTTP/2 headers
    • headerName

      public Http.HeaderName headerName()
      Description copied from interface: Http.HeaderValue
      Header name for the header.
      Specified by:
      headerName in interface Http.HeaderValue
      Returns:
      header name
    • value

      public String value()
      Description copied from interface: Http.HeaderValue
      First value of this header.
      Specified by:
      value in interface Http.HeaderValue
      Returns:
      the first value
    • value

      public <T> T value(Class<T> type)
      Description copied from interface: Http.HeaderValue
      Value mapped using a MapperManager.
      Specified by:
      value in interface Http.HeaderValue
      Type Parameters:
      T - type of the value
      Parameters:
      type - class of the value
      Returns:
      typed value
    • allValues

      public List<String> allValues()
      Description copied from interface: Http.HeaderValue
      All values of this header.
      Specified by:
      allValues in interface Http.HeaderValue
      Returns:
      all configured values
    • valueCount

      public int valueCount()
      Description copied from interface: Http.HeaderValue
      Number of values this header has.
      Specified by:
      valueCount in interface Http.HeaderValue
      Returns:
      number of values (minimal number is 1)
    • sensitive

      public boolean sensitive()
      Description copied from interface: Http.HeaderValue
      Sensitive headers should not be logged, or indexed (HTTP/2).
      Specified by:
      sensitive in interface Http.HeaderValue
      Returns:
      whether this header is sensitive
    • changing

      public boolean changing()
      Description copied from interface: Http.HeaderValue
      Changing headers should not be cached, and their value should not be indexed (HTTP/2).
      Specified by:
      changing in interface Http.HeaderValue
      Returns:
      whether this header's value is changing often
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • contentName

      public Optional<String> contentName()
      Get the value of the name parameter. In the case of a form-data disposition type the value is the original field name from the form.
      Returns:
      Optional<String>, never null
    • filename

      public Optional<String> filename()
      Get the value of the filename parameter that can be used to suggest a filename to be used if the entity is detached and stored in a separate file.
      Returns:
      Optional<String>, never null
    • creationDate

      public Optional<ZonedDateTime> creationDate()
      Get the value of the creation-date parameter that can be used to indicate the date at which the file was created.
      Returns:
      Optional<ZonedDateTime>, never null
    • modificationDate

      public Optional<ZonedDateTime> modificationDate()
      Get the value of the modification-date parameter that can be used to indicate the date at which the file was last modified.
      Returns:
      Optional<ZonedDateTime>, never null
    • readDate

      public Optional<ZonedDateTime> readDate()
      Get the value of the modification-date parameter that can be used to indicate the date at which the file was last read.
      Returns:
      Optional<ZonedDateTime>, never null
    • size

      public OptionalLong size()
      Get the value of the size parameter that can be used to indicate an approximate size of the file in octets.
      Returns:
      OptionalLong, never null
    • parameters

      public Map<String,String> parameters()
      Get the parameters map.
      Returns:
      map, never null
    • type

      public String type()
      Content disposition type.
      Returns:
      type of this content disposition