public class ContentDisposition
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ContentDisposition.Builder
A mutable builder for
ContentDisposition . |
private static class |
ContentDisposition.BuilderImpl |
Modifier and Type | Field and Description |
---|---|
private java.nio.charset.Charset |
charset |
private java.time.ZonedDateTime |
creationDate |
private java.lang.String |
filename |
private java.time.ZonedDateTime |
modificationDate |
private java.lang.String |
name |
private java.time.ZonedDateTime |
readDate |
private java.lang.Long |
size |
private java.lang.String |
type |
Modifier | Constructor and Description |
---|---|
private |
ContentDisposition(java.lang.String type,
java.lang.String name,
java.lang.String filename,
java.nio.charset.Charset charset,
java.lang.Long size,
java.time.ZonedDateTime creationDate,
java.time.ZonedDateTime modificationDate,
java.time.ZonedDateTime readDate)
Private constructor.
|
Modifier and Type | Method and Description |
---|---|
static ContentDisposition.Builder |
builder(java.lang.String type)
Return a builder for a
ContentDisposition . |
private static java.lang.String |
decodeHeaderFieldParam(java.lang.String input)
Decode the given header field param as describe in RFC 5987.
|
static ContentDisposition |
empty()
Return an empty content disposition.
|
private static java.lang.String |
encodeHeaderFieldParam(java.lang.String input,
java.nio.charset.Charset charset)
Encode the given header field param as describe in RFC 5987.
|
boolean |
equals(java.lang.Object other) |
java.nio.charset.Charset |
getCharset()
Return the charset defined in filename* parameter, or
null if not defined. |
java.time.ZonedDateTime |
getCreationDate()
Return the value of the creation-date parameter, or
null if not defined. |
java.lang.String |
getFilename()
Return the value of the filename parameter (or the value of the
filename* one decoded as defined in the RFC 5987), or
null if not defined. |
java.time.ZonedDateTime |
getModificationDate()
Return the value of the modification-date parameter, or
null if not defined. |
java.lang.String |
getName()
Return the value of the name parameter, or
null if not defined. |
java.time.ZonedDateTime |
getReadDate()
Return the value of the read-date parameter, or
null if not defined. |
java.lang.Long |
getSize()
Return the value of the size parameter, or
null if not defined. |
java.lang.String |
getType()
Return the disposition type, like for example inline, attachment,
form-data, or
null if not defined. |
int |
hashCode() |
private static boolean |
isRFC5987AttrChar(byte c) |
static ContentDisposition |
parse(java.lang.String contentDisposition)
Parse a Content-Disposition header value as defined in RFC 2183.
|
private static java.util.List<java.lang.String> |
tokenize(java.lang.String headerValue) |
java.lang.String |
toString()
Return the header value for this content disposition as defined in RFC 2183.
|
@Nullable private final java.lang.String type
@Nullable private final java.lang.String name
@Nullable private final java.lang.String filename
@Nullable private final java.nio.charset.Charset charset
@Nullable private final java.lang.Long size
@Nullable private final java.time.ZonedDateTime creationDate
@Nullable private final java.time.ZonedDateTime modificationDate
@Nullable private final java.time.ZonedDateTime readDate
private ContentDisposition(@Nullable java.lang.String type, @Nullable java.lang.String name, @Nullable java.lang.String filename, @Nullable java.nio.charset.Charset charset, @Nullable java.lang.Long size, @Nullable java.time.ZonedDateTime creationDate, @Nullable java.time.ZonedDateTime modificationDate, @Nullable java.time.ZonedDateTime readDate)
@Nullable public java.lang.String getType()
null
if not defined.@Nullable public java.lang.String getName()
null
if not defined.@Nullable public java.lang.String getFilename()
null
if not defined.@Nullable public java.nio.charset.Charset getCharset()
null
if not defined.@Nullable public java.lang.Long getSize()
null
if not defined.@Nullable public java.time.ZonedDateTime getCreationDate()
null
if not defined.@Nullable public java.time.ZonedDateTime getModificationDate()
null
if not defined.@Nullable public java.time.ZonedDateTime getReadDate()
null
if not defined.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
parse(String)
public static ContentDisposition.Builder builder(java.lang.String type)
ContentDisposition
.type
- the disposition type like for example inline,
attachment, or form-datapublic static ContentDisposition empty()
public static ContentDisposition parse(java.lang.String contentDisposition)
contentDisposition
- the Content-Disposition header valuetoString()
private static java.util.List<java.lang.String> tokenize(java.lang.String headerValue)
private static java.lang.String decodeHeaderFieldParam(java.lang.String input)
Only the US-ASCII, UTF-8 and ISO-8859-1 charsets are supported.
input
- the header field paramprivate static boolean isRFC5987AttrChar(byte c)
private static java.lang.String encodeHeaderFieldParam(java.lang.String input, java.nio.charset.Charset charset)
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