Class ContentDisposition
java.lang.Object
org.glassfish.jersey.media.multipart.ContentDisposition
- Direct Known Subclasses:
FormDataContentDisposition
A content disposition header.
- Author:
- Paul Sandoz, imran@smartitengineering.com, Marek Potociar
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ContentDisposition.ContentDispositionBuilder<T extends ContentDisposition.ContentDispositionBuilder,
V extends ContentDisposition> Builder to build content disposition. -
Constructor Summary
ModifierConstructorDescriptionContentDisposition
(String header) ContentDisposition
(String header, boolean fileNameFix) protected
ContentDisposition
(String type, String fileName, Date creationDate, Date modificationDate, Date readDate, long size) ContentDisposition
(HttpHeaderReader reader, boolean fileNameFix) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDateParameter
(StringBuilder sb, String name, Date p) protected void
addLongParameter
(StringBuilder sb, String name, Long p) protected void
addStringParameter
(StringBuilder sb, String name, String p) protected String
encodeAsciiFileName
(String fileName) Get the creation-date parameter.Get the filename parameter.getFileName
(boolean decodeExtended) Get the filename parameter.Get the modification-date parameter.Get the parameters.Get the read-date parameter.long
getSize()
Get the size parameter.getType()
Get the type.toString()
Convert the disposition to a "Content-Disposition" header value.protected StringBuilder
Start building content disposition.
-
Constructor Details
-
ContentDisposition
-
ContentDisposition
- Throws:
ParseException
-
ContentDisposition
- Throws:
ParseException
-
ContentDisposition
- Throws:
ParseException
-
-
Method Details
-
getType
Get the type.- Returns:
- the type
-
getParameters
Get the parameters.- Returns:
- the parameters
-
getFileName
Get the filename parameter. Automatically decodes RFC 5987 extended filename*= to be human-readable.- Returns:
- the file name
-
getFileName
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 whentrue
- Returns:
- the filename or the RFC 5987 extended filename
-
getCreationDate
Get the creation-date parameter.- Returns:
- the creationDate
-
getModificationDate
Get the modification-date parameter.- Returns:
- the modificationDate
-
getReadDate
Get the read-date parameter.- Returns:
- the readDate
-
getSize
public long getSize()Get the size parameter.- Returns:
- the size
-
toString
Convert the disposition to a "Content-Disposition" header value. -
toStringBuffer
-
addStringParameter
-
addDateParameter
-
addLongParameter
-
encodeAsciiFileName
-
type
Start building content disposition.- Parameters:
type
- the disposition type.- Returns:
- the content disposition builder.
-