Class ContentDisposition

java.lang.Object
org.glassfish.jersey.media.multipart.ContentDisposition
Direct Known Subclasses:
FormDataContentDisposition

public class ContentDisposition extends Object
A content disposition header.
Author:
Paul Sandoz, imran@smartitengineering.com, Marek Potociar
  • Constructor Details

  • Method Details

    • getType

      public String getType()
      Get the type.
      Returns:
      the type
    • getParameters

      public Map<String,String> getParameters()
      Get the parameters.
      Returns:
      the parameters
    • getFileName

      public String getFileName()
      Get the filename parameter. Automatically decodes RFC 5987 extended filename*= to be human-readable.
      Returns:
      the file name
    • getFileName

      public String getFileName(boolean decodeExtended)
      Get the filename parameter. If the RFC 5987 extended filename*= is received in Content-Disposition, its encoded value can be decoded to be human-readable.
      Parameters:
      decodeExtended - decode the filename* to be human-readable when true
      Returns:
      the filename or the RFC 5987 extended filename
    • getCreationDate

      public Date getCreationDate()
      Get the creation-date parameter.
      Returns:
      the creationDate
    • getModificationDate

      public Date getModificationDate()
      Get the modification-date parameter.
      Returns:
      the modificationDate
    • getReadDate

      public Date getReadDate()
      Get the read-date parameter.
      Returns:
      the readDate
    • getSize

      public long getSize()
      Get the size parameter.
      Returns:
      the size
    • toString

      public String toString()
      Convert the disposition to a "Content-Disposition" header value.
      Overrides:
      toString in class Object
      Returns:
      the "Content-Disposition" value.
    • toStringBuffer

      protected StringBuilder toStringBuffer()
    • addStringParameter

      protected void addStringParameter(StringBuilder sb, String name, String p)
    • addDateParameter

      protected void addDateParameter(StringBuilder sb, String name, Date p)
    • addLongParameter

      protected void addLongParameter(StringBuilder sb, String name, Long p)
    • encodeAsciiFileName

      protected String encodeAsciiFileName(String fileName)
    • type

      Start building content disposition.
      Parameters:
      type - the disposition type.
      Returns:
      the content disposition builder.