Class ContentDisposition
java.lang.Object
io.helidon.http.ContentDisposition
A generic representation of the
Content-Disposition header.
Parameter encoding is not supported, other than
URI percent
encoding in the filename parameter. See URLDecoder.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionAll values of this header.<N> Value<N> as(GenericType<N> type) Convert this value to a different type using a mapper.<N> Value<N> Convert this value to a different type using a mapper.<N> Value<N> Convert thisValueto a different type using a mapper function.Boolean typed value.asDouble()Double typed value.asInt()Integer typed value.asLong()Long typed value.Typed value asOptional.asString()String typed value.static ContentDisposition.Builderbuilder()A new builder to set up content disposition.booleanchanging()Changing headers should not be cached, and their value should not be indexed (HTTP/2).Get the value of thenameparameter.Get the value of thecreation-dateparameter that can be used to indicate the date at which the file was created.static ContentDispositionempty()An empty content disposition.filename()Get the value of thefilenameparameter that can be used to suggest a filename to be used if the entity is detached and stored in a separate file.get()Typed value.Header name for the header.Get the value of themodification-dateparameter that can be used to indicate the date at which the file was last modified.name()Name of the header as configured by user or as received on the wire.Get the parameters map.static ContentDispositionParse a received header value.readDate()Get the value of themodification-dateparameter that can be used to indicate the date at which the file was last read.booleanSensitive headers should not be logged, or indexed (HTTP/2).size()Get the value of thesizeparameter that can be used to indicate an approximate size of the file in octets.toString()type()Content disposition type.intNumber of values this header has.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Header
allValues, validate, valueBytes, values, writeHttp1HeaderModifier and TypeMethodDescriptionallValues(boolean split) All values of this header.default voidvalidate()Check validity of the header name and values.default byte[]Bytes of a single-valued header value.default Stringvalues()All values concatenated using a comma and a space.default voidwriteHttp1Header(BufferData buffer) Write the current header as an HTTP header to the provided buffer.Methods inherited from interface Value
filter, flatMap, get, get, getBoolean, getDouble, getInt, getLong, getString, streamModifier and TypeMethodDescriptionIf a value is present, and the value matches the given predicate, return anOptionaldescribing the value, otherwise return an emptyOptional.default <U> Optional<U> Apply the providedOptional-bearing mapping function to this value, return that result.default <N> Nget(GenericType<N> type) Convert this value to a different type using a mapper.default <N> NConvert this value to a different type using a mapper.default booleanBoolean typed value.default doubleDouble typed value.default intgetInt()Integer typed value.default longgetLong()Long typed value.default StringString typed value.stream()If a value is present, returns a sequentialStreamcontaining only that value, otherwise returns an emptyStream.
-
Method Details
-
builder
A new builder to set up content disposition.- Returns:
- builder
-
parse
Parse a received header value.- Parameters:
headerValue- content disposition header value- Returns:
- a parsed content disposition
-
empty
An empty content disposition.- Returns:
- empty disposition with empty type
-
name
-
headerName
Description copied from interface:HeaderHeader name for the header.- Specified by:
headerNamein interfaceHeader- Returns:
- header name
-
get
-
as
Description copied from interface:ValueConvert this value to a different type using a mapper.- Specified by:
asin interfaceValue<String>- Type Parameters:
N- type we expect- Parameters:
type- type to convert to- Returns:
- converted value
- Throws:
MapperException- in case the value cannot be converted
-
as
Description copied from interface:ValueConvert this value to a different type using a mapper.- Specified by:
asin interfaceValue<String>- Type Parameters:
N- type we expect- Parameters:
type- type to convert to- Returns:
- converted value
- Throws:
MapperException
-
as
Description copied from interface:ValueConvert thisValueto a different type using a mapper function. -
asOptional
Description copied from interface:ValueTyped value asOptional. Returns aemptyif this value does not have a backing value present. As this class implements all methods ofOptional, this is only a utility method if an actualOptionalinstance is needed (Optionalitself is {code final}).- Specified by:
asOptionalin interfaceValue<String>- Returns:
- value as
Optional,emptyin case the value does not have a direct value - Throws:
MapperException- in case the value cannot be converted to the expected type- See Also:
-
asBoolean
-
asString
-
asInt
-
asLong
-
asDouble
-
allValues
-
valueCount
public int valueCount()Description copied from interface:HeaderNumber of values this header has.- Specified by:
valueCountin interfaceHeader- Returns:
- number of values (minimal number is 1)
-
sensitive
-
changing
-
toString
-
contentName
-
filename
Get the value of thefilenameparameter that can be used to suggest a filename to be used if the entity is detached and stored in a separate file.The value is percent-decoded. Any directory path information in the parameter is ignored and only the final path segment is returned. An invalid final segment, such as an empty name,
.,.., or a name containing control characters, causes anIllegalArgumentException.- Returns:
Optional<String>, nevernull- Throws:
IllegalArgumentException- if the filename is malformed or unsafe
-
creationDate
Get the value of thecreation-dateparameter that can be used to indicate the date at which the file was created.- Returns:
Optional<ZonedDateTime>, nevernull
-
modificationDate
Get the value of themodification-dateparameter that can be used to indicate the date at which the file was last modified.- Returns:
Optional<ZonedDateTime>, nevernull
-
readDate
Get the value of themodification-dateparameter that can be used to indicate the date at which the file was last read.- Returns:
Optional<ZonedDateTime>, nevernull
-
size
Get the value of thesizeparameter that can be used to indicate an approximate size of the file in octets.- Returns:
OptionalLong, nevernull
-
parameters
-
type
-