Class ContentDisposition

java.lang.Object
io.helidon.http.ContentDisposition
All Implemented Interfaces:
io.helidon.common.mapper.Value<String>, Header

public class ContentDisposition extends Object implements Header
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: Header
      Name of the header as configured by user or as received on the wire.
      Specified by:
      name in interface Header
      Specified by:
      name in interface io.helidon.common.mapper.Value<String>
      Returns:
      header name, always lower case for HTTP/2 headers
    • headerName

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

      public String get()
      Specified by:
      get in interface io.helidon.common.mapper.Value<String>
    • as

      public <N> io.helidon.common.mapper.Value<N> as(Class<N> type) throws io.helidon.common.mapper.MapperException
      Specified by:
      as in interface io.helidon.common.mapper.Value<String>
      Throws:
      io.helidon.common.mapper.MapperException
    • as

      public <N> io.helidon.common.mapper.Value<N> as(io.helidon.common.GenericType<N> type) throws io.helidon.common.mapper.MapperException
      Specified by:
      as in interface io.helidon.common.mapper.Value<String>
      Throws:
      io.helidon.common.mapper.MapperException
    • as

      public <N> io.helidon.common.mapper.Value<N> as(Function<? super String,? extends N> mapper)
      Specified by:
      as in interface io.helidon.common.mapper.Value<String>
    • asOptional

      public Optional<String> asOptional() throws io.helidon.common.mapper.MapperException
      Specified by:
      asOptional in interface io.helidon.common.mapper.Value<String>
      Throws:
      io.helidon.common.mapper.MapperException
    • asBoolean

      public io.helidon.common.mapper.Value<Boolean> asBoolean()
      Specified by:
      asBoolean in interface io.helidon.common.mapper.Value<String>
    • asString

      public io.helidon.common.mapper.Value<String> asString()
      Specified by:
      asString in interface io.helidon.common.mapper.Value<String>
    • asInt

      public io.helidon.common.mapper.Value<Integer> asInt()
      Specified by:
      asInt in interface io.helidon.common.mapper.Value<String>
    • asLong

      public io.helidon.common.mapper.Value<Long> asLong()
      Specified by:
      asLong in interface io.helidon.common.mapper.Value<String>
    • asDouble

      public io.helidon.common.mapper.Value<Double> asDouble()
      Specified by:
      asDouble in interface io.helidon.common.mapper.Value<String>
    • allValues

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

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

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

      public boolean changing()
      Description copied from interface: Header
      Changing headers should not be cached, and their value should not be indexed (HTTP/2).
      Specified by:
      changing in interface Header
      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