Class ContentDisposition
- java.lang.Object
-
- org.glassfish.jersey.media.multipart.ContentDisposition
-
- Direct Known Subclasses:
FormDataContentDisposition
public class ContentDisposition extends java.lang.ObjectA content disposition header.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContentDisposition.ContentDispositionBuilder<T extends ContentDisposition.ContentDispositionBuilder,V extends ContentDisposition>Builder to build content disposition.
-
Field Summary
Fields Modifier and Type Field Description private java.util.DatecreationDateprivate java.lang.StringfileNameprivate java.util.DatemodificationDateprivate java.util.Map<java.lang.String,java.lang.String>parametersprivate java.util.DatereadDateprivate longsizeprivate java.lang.CharSequencetype
-
Constructor Summary
Constructors Modifier Constructor Description ContentDisposition(java.lang.String header)ContentDisposition(java.lang.String header, boolean fileNameFix)protectedContentDisposition(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 voidaddDateParameter(java.lang.StringBuilder sb, java.lang.String name, java.util.Date p)protected voidaddLongParameter(java.lang.StringBuilder sb, java.lang.String name, java.lang.Long p)protected voidaddStringParameter(java.lang.StringBuilder sb, java.lang.String name, java.lang.String p)private java.util.DatecreateDate(java.lang.String name)private longcreateLong(java.lang.String name)private voidcreateParameters()java.util.DategetCreationDate()Get the creation-date parameter.java.lang.StringgetFileName()Get the filename parameter.java.util.DategetModificationDate()Get the modification-date parameter.java.util.Map<java.lang.String,java.lang.String>getParameters()Get the parameters.java.util.DategetReadDate()Get the read-date parameter.longgetSize()Get the size parameter.java.lang.StringgetType()Get the type.java.lang.StringtoString()Convert the disposition to a "Content-Disposition" header value.protected java.lang.StringBuildertoStringBuffer()static ContentDisposition.ContentDispositionBuildertype(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:
toStringin 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.
-
-