Class ContentDisposition

  • Direct Known Subclasses:
    FormDataContentDisposition

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

      • 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.
      • encodeAsciiFileName

        protected String encodeAsciiFileName​(String fileName)