Class ContentDisposition
- java.lang.Object
-
- org.glassfish.jersey.media.multipart.ContentDisposition
-
- Direct Known Subclasses:
FormDataContentDisposition
public class ContentDisposition extends java.lang.Object
A content disposition header.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContentDisposition.ContentDispositionBuilder<T extends ContentDisposition.ContentDispositionBuilder,V extends ContentDisposition>
Builder to build content disposition.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Date
creationDate
private java.lang.String
fileName
private java.util.Date
modificationDate
private java.util.Map<java.lang.String,java.lang.String>
parameters
private java.util.Date
readDate
private long
size
private java.lang.CharSequence
type
-
Constructor Summary
Constructors Modifier Constructor Description ContentDisposition(java.lang.String header)
ContentDisposition(java.lang.String header, boolean fileNameFix)
protected
ContentDisposition(java.lang.String type, java.lang.String fileName, java.util.Date creationDate, java.util.Date modificationDate, java.util.Date readDate, long size)
ContentDisposition(HttpHeaderReader reader, boolean fileNameFix)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addDateParameter(java.lang.StringBuilder sb, java.lang.String name, java.util.Date p)
protected void
addLongParameter(java.lang.StringBuilder sb, java.lang.String name, java.lang.Long p)
protected void
addStringParameter(java.lang.StringBuilder sb, java.lang.String name, java.lang.String p)
private java.util.Date
createDate(java.lang.String name)
private long
createLong(java.lang.String name)
private void
createParameters()
java.util.Date
getCreationDate()
Get the creation-date parameter.java.lang.String
getFileName()
Get the filename parameter.java.util.Date
getModificationDate()
Get the modification-date parameter.java.util.Map<java.lang.String,java.lang.String>
getParameters()
Get the parameters.java.util.Date
getReadDate()
Get the read-date parameter.long
getSize()
Get the size parameter.java.lang.String
getType()
Get the type.java.lang.String
toString()
Convert the disposition to a "Content-Disposition" header value.protected java.lang.StringBuilder
toStringBuffer()
static ContentDisposition.ContentDispositionBuilder
type(java.lang.String type)
Start building content disposition.
-
-
-
Field Detail
-
type
private final java.lang.CharSequence type
-
parameters
private final java.util.Map<java.lang.String,java.lang.String> parameters
-
fileName
private java.lang.String fileName
-
creationDate
private java.util.Date creationDate
-
modificationDate
private java.util.Date modificationDate
-
readDate
private java.util.Date readDate
-
size
private long size
-
-
Constructor Detail
-
ContentDisposition
protected ContentDisposition(java.lang.String type, java.lang.String fileName, java.util.Date creationDate, java.util.Date modificationDate, java.util.Date readDate, long size)
-
ContentDisposition
public ContentDisposition(java.lang.String header) throws java.text.ParseException
- Throws:
java.text.ParseException
-
ContentDisposition
public ContentDisposition(java.lang.String header, boolean fileNameFix) throws java.text.ParseException
- Throws:
java.text.ParseException
-
ContentDisposition
public ContentDisposition(HttpHeaderReader reader, boolean fileNameFix) throws java.text.ParseException
- Throws:
java.text.ParseException
-
-
Method Detail
-
getType
public java.lang.String getType()
Get the type.- Returns:
- the type
-
getParameters
public java.util.Map<java.lang.String,java.lang.String> getParameters()
Get the parameters.- Returns:
- the parameters
-
getFileName
public java.lang.String getFileName()
Get the filename parameter.- Returns:
- the size
-
getCreationDate
public java.util.Date getCreationDate()
Get the creation-date parameter.- Returns:
- the creationDate
-
getModificationDate
public java.util.Date getModificationDate()
Get the modification-date parameter.- Returns:
- the modificationDate
-
getReadDate
public java.util.Date getReadDate()
Get the read-date parameter.- Returns:
- the readDate
-
getSize
public long getSize()
Get the size parameter.- Returns:
- the size
-
toString
public java.lang.String toString()
Convert the disposition to a "Content-Disposition" header value.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the "Content-Disposition" value.
-
toStringBuffer
protected java.lang.StringBuilder toStringBuffer()
-
addStringParameter
protected void addStringParameter(java.lang.StringBuilder sb, java.lang.String name, java.lang.String p)
-
addDateParameter
protected void addDateParameter(java.lang.StringBuilder sb, java.lang.String name, java.util.Date p)
-
addLongParameter
protected void addLongParameter(java.lang.StringBuilder sb, java.lang.String name, java.lang.Long p)
-
createParameters
private void createParameters() throws java.text.ParseException
- Throws:
java.text.ParseException
-
createDate
private java.util.Date createDate(java.lang.String name) throws java.text.ParseException
- Throws:
java.text.ParseException
-
createLong
private long createLong(java.lang.String name) throws java.text.ParseException
- Throws:
java.text.ParseException
-
type
public static ContentDisposition.ContentDispositionBuilder type(java.lang.String type)
Start building content disposition.- Parameters:
type
- the disposition type.- Returns:
- the content disposition builder.
-
-