类 ContentDisposition

java.lang.Object
cn.taketoday.http.ContentDisposition

public final class ContentDisposition extends Object
Represent the Content-Disposition type and parameters as defined in RFC 6266.
作者:
Sebastien Deleuze, Juergen Hoeller, Rossen Stoyanchev, TODAY
2020-01-31 12:37
另请参阅:
  • 字段详细资料

    • BASE64_ENCODED_PATTERN

      private static final Pattern BASE64_ENCODED_PATTERN
    • QUOTED_PRINTABLE_ENCODED_PATTERN

      private static final Pattern QUOTED_PRINTABLE_ENCODED_PATTERN
    • INVALID_HEADER_FIELD_PARAMETER_FORMAT

      private static final String INVALID_HEADER_FIELD_PARAMETER_FORMAT
      另请参阅:
    • type

      @Nullable private final String type
    • name

      @Nullable private final String name
    • filename

      @Nullable private final String filename
    • charset

      @Nullable private final Charset charset
    • size

      @Nullable private final Long size
    • creationDate

      @Nullable private final ZonedDateTime creationDate
    • modificationDate

      @Nullable private final ZonedDateTime modificationDate
    • readDate

      @Nullable private final ZonedDateTime readDate
  • 构造器详细资料

    • ContentDisposition

      private ContentDisposition(@Nullable String type, @Nullable String name, @Nullable String filename, @Nullable Charset charset, @Nullable Long size, @Nullable ZonedDateTime creationDate, @Nullable ZonedDateTime modificationDate, @Nullable ZonedDateTime readDate)
      Private constructor. See static factory methods in this class.
  • 方法详细资料

    • isAttachment

      public boolean isAttachment()
      Return whether the type is "attachment".
    • isFormData

      public boolean isFormData()
      Return whether the type is "form-data".
    • isInline

      public boolean isInline()
      Return whether the type is "inline".
    • getType

      @Nullable public String getType()
      Return the disposition type.
      另请参阅:
    • getName

      @Nullable public String getName()
      Return the value of the name parameter, or null if not defined.
    • getFilename

      @Nullable public String getFilename()
      Return the value of the filename parameter, possibly decoded from BASE64 encoding based on RFC 2047, or of the filename* parameter, possibly decoded as defined in the RFC 5987.
    • getCharset

      @Nullable public Charset getCharset()
      Return the charset defined in filename* parameter, or null if not defined.
    • getSize

      @Nullable public Long getSize()
      Return the value of the size parameter, or null if not defined.
    • getCreationDate

      @Nullable public ZonedDateTime getCreationDate()
      Return the value of the creation-date parameter, or null if not defined.
    • getModificationDate

      @Nullable public ZonedDateTime getModificationDate()
      Return the value of the modification-date parameter, or null if not defined.
    • getReadDate

      @Nullable public ZonedDateTime getReadDate()
      Return the value of the read-date parameter, or null if not defined.
    • equals

      public boolean equals(@Nullable Object other)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      Return the header value for this content disposition as defined in RFC 6266.
      覆盖:
      toString 在类中 Object
      另请参阅:
    • attachment

      public static ContentDisposition.Builder attachment()
      Return a builder for a ContentDisposition of type "attachment".
    • formData

      public static ContentDisposition.Builder formData()
      Return a builder for a ContentDisposition of type "form-data".
    • inline

      public static ContentDisposition.Builder inline()
      Return a builder for a ContentDisposition of type "inline".
    • builder

      public static ContentDisposition.Builder builder(String type)
      Return a builder for a ContentDisposition.
      参数:
      type - the disposition type like for example inline, attachment, or form-data
      返回:
      the builder
    • empty

      public static ContentDisposition empty()
      Return an empty content disposition.
    • parse

      public static ContentDisposition parse(String contentDisposition)
      Parse a Content-Disposition header value as defined in RFC 2183.
      参数:
      contentDisposition - the Content-Disposition header value
      返回:
      the parsed content disposition
      另请参阅:
    • parseZonedDateTime

      private static ZonedDateTime parseZonedDateTime(String value)
    • tokenize

      private static List<String> tokenize(String headerValue)
    • decodeRfc5987Filename

      private static String decodeRfc5987Filename(String filename, Charset charset)
      Decode the given header field param as described in RFC 5987.

      Only the US-ASCII, UTF-8 and ISO-8859-1 charsets are supported.

      参数:
      filename - the filename
      charset - the charset for the filename
      返回:
      the encoded header field param
      另请参阅:
    • isRFC5987AttrChar

      private static boolean isRFC5987AttrChar(byte c)
    • decodeQuotedPrintableFilename

      private static String decodeQuotedPrintableFilename(String filename, Charset charset)
      Decode the given header field param as described in RFC 2047.
      参数:
      filename - the filename
      charset - the charset for the filename
      返回:
      the decoded header field param
      另请参阅:
    • encodeQuotedPrintableFilename

      private static String encodeQuotedPrintableFilename(String filename, Charset charset)
      Encode the given header field param as described in RFC 2047.
      参数:
      filename - the filename
      charset - the charset for the filename
      返回:
      the encoded header field param
      另请参阅:
    • isPrintable

      private static boolean isPrintable(byte c)
    • encodeQuotedPairs

      private static String encodeQuotedPairs(String filename)
    • decodeQuotedPairs

      private static String decodeQuotedPairs(String filename)
    • encodeRfc5987Filename

      private static String encodeRfc5987Filename(String input, Charset charset)
      Encode the given header field param as describe in RFC 5987.
      参数:
      input - the header field param
      charset - the charset of the header field param string, only the US-ASCII, UTF-8 and ISO-8859-1 charsets are supported
      返回:
      the encoded header field param
      另请参阅:
    • hexDigit

      private static char hexDigit(int b)