类 ContentDisposition
java.lang.Object
cn.taketoday.http.ContentDisposition
Represent the Content-Disposition type and parameters as defined in RFC 6266.
- 作者:
- Sebastien Deleuze, Juergen Hoeller, Rossen Stoyanchev, TODAY
2020-01-31 12:37 - 另请参阅:
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private static final Patternprivate final Charsetprivate final ZonedDateTimeprivate final Stringprivate static final Stringprivate final ZonedDateTimeprivate final Stringprivate static final Patternprivate final ZonedDateTimeprivate final Longprivate final String -
构造器概要
构造器限定符构造器说明privateContentDisposition(String type, String name, String filename, Charset charset, Long size, ZonedDateTime creationDate, ZonedDateTime modificationDate, ZonedDateTime readDate) Private constructor. -
方法概要
修饰符和类型方法说明static ContentDisposition.BuilderReturn a builder for aContentDispositionof type "attachment".static ContentDisposition.BuilderReturn a builder for aContentDisposition.private static StringdecodeQuotedPairs(String filename) private static StringdecodeQuotedPrintableFilename(String filename, Charset charset) Decode the given header field param as described in RFC 2047.private static StringdecodeRfc5987Filename(String filename, Charset charset) Decode the given header field param as described in RFC 5987.static ContentDispositionempty()Return an empty content disposition.private static StringencodeQuotedPairs(String filename) private static StringencodeQuotedPrintableFilename(String filename, Charset charset) Encode the given header field param as described in RFC 2047.private static StringencodeRfc5987Filename(String input, Charset charset) Encode the given header field param as describe in RFC 5987.booleanstatic ContentDisposition.BuilderformData()Return a builder for aContentDispositionof type "form-data".Return the charset defined in filename* parameter, ornullif not defined.Return the value of the creation-date parameter, ornullif not defined.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.Return the value of the modification-date parameter, ornullif not defined.getName()Return the value of the name parameter, ornullif not defined.Return the value of the read-date parameter, ornullif not defined.getSize()Return the value of the size parameter, ornullif not defined.getType()Return the disposition type.inthashCode()private static charhexDigit(int b) static ContentDisposition.Builderinline()Return a builder for aContentDispositionof type "inline".booleanReturn whether thetypeis "attachment".booleanReturn whether thetypeis "form-data".booleanisInline()Return whether thetypeis "inline".private static booleanisPrintable(byte c) private static booleanisRFC5987AttrChar(byte c) static ContentDispositionParse a Content-Disposition header value as defined in RFC 2183.private static ZonedDateTimeparseZonedDateTime(String value) toString()Return the header value for this content disposition as defined in RFC 6266.
-
字段详细资料
-
BASE64_ENCODED_PATTERN
-
QUOTED_PRINTABLE_ENCODED_PATTERN
-
INVALID_HEADER_FIELD_PARAMETER_FORMAT
- 另请参阅:
-
type
-
name
-
filename
-
charset
-
size
-
creationDate
-
modificationDate
-
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 thetypeis "attachment". -
isFormData
public boolean isFormData()Return whether thetypeis "form-data". -
isInline
public boolean isInline()Return whether thetypeis "inline". -
getType
Return the disposition type. -
getName
Return the value of the name parameter, ornullif not defined. -
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
Return the charset defined in filename* parameter, ornullif not defined. -
getSize
Return the value of the size parameter, ornullif not defined. -
getCreationDate
Return the value of the creation-date parameter, ornullif not defined. -
getModificationDate
Return the value of the modification-date parameter, ornullif not defined. -
getReadDate
Return the value of the read-date parameter, ornullif not defined. -
equals
-
hashCode
public int hashCode() -
toString
Return the header value for this content disposition as defined in RFC 6266. -
attachment
Return a builder for aContentDispositionof type "attachment". -
formData
Return a builder for aContentDispositionof type "form-data". -
inline
Return a builder for aContentDispositionof type "inline". -
builder
Return a builder for aContentDisposition.- 参数:
type- the disposition type like for example inline, attachment, or form-data- 返回:
- the builder
-
empty
Return an empty content disposition. -
parse
Parse a Content-Disposition header value as defined in RFC 2183.- 参数:
contentDisposition- the Content-Disposition header value- 返回:
- the parsed content disposition
- 另请参阅:
-
parseZonedDateTime
-
tokenize
-
decodeRfc5987Filename
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 filenamecharset- the charset for the filename- 返回:
- the encoded header field param
- 另请参阅:
-
isRFC5987AttrChar
private static boolean isRFC5987AttrChar(byte c) -
decodeQuotedPrintableFilename
Decode the given header field param as described in RFC 2047.- 参数:
filename- the filenamecharset- the charset for the filename- 返回:
- the decoded header field param
- 另请参阅:
-
encodeQuotedPrintableFilename
Encode the given header field param as described in RFC 2047.- 参数:
filename- the filenamecharset- the charset for the filename- 返回:
- the encoded header field param
- 另请参阅:
-
isPrintable
private static boolean isPrintable(byte c) -
encodeQuotedPairs
-
decodeQuotedPairs
-
encodeRfc5987Filename
Encode the given header field param as describe in RFC 5987.- 参数:
input- the header field paramcharset- 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)
-