Class ContentDisposition

java.lang.Object
io.helidon.media.multipart.ContentDisposition

public final class ContentDisposition extends Object
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

    • type

      public String type()
      The content disposition type.
      Returns:
      type, never null
    • name

      public Optional<String> name()
      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
    • toString

      public String toString()
      Convert the content disposition to a string suitable for use as the value of a corresponding HTTP header.
      Overrides:
      toString in class Object
      Returns:
      a string version of the content disposition
    • builder

      public static ContentDisposition.Builder builder()
      Create a new builder instance.
      Returns:
      Builder