Class ContentDisposition
- java.lang.Object
-
- org.glassfish.jersey.media.multipart.ContentDisposition
-
- Direct Known Subclasses:
FormDataContentDisposition
public class ContentDisposition extends Object
A content disposition header.- Author:
- Paul Sandoz, imran@smartitengineering.com, Marek Potociar
-
-
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.
-
Constructor Summary
Constructors Modifier Constructor Description ContentDisposition(String header)ContentDisposition(String header, boolean fileNameFix)protectedContentDisposition(String type, String fileName, Date creationDate, Date modificationDate, 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(StringBuilder sb, String name, Date p)protected voidaddLongParameter(StringBuilder sb, String name, Long p)protected voidaddStringParameter(StringBuilder sb, String name, String p)DategetCreationDate()Get the creation-date parameter.StringgetFileName()Get the filename parameter.DategetModificationDate()Get the modification-date parameter.Map<String,String>getParameters()Get the parameters.DategetReadDate()Get the read-date parameter.longgetSize()Get the size parameter.StringgetType()Get the type.StringtoString()Convert the disposition to a "Content-Disposition" header value.protected StringBuildertoStringBuffer()static ContentDisposition.ContentDispositionBuildertype(String type)Start building content disposition.
-
-
-
Constructor Detail
-
ContentDisposition
protected ContentDisposition(String type, String fileName, Date creationDate, Date modificationDate, Date readDate, long size)
-
ContentDisposition
public ContentDisposition(String header) throws ParseException
- Throws:
ParseException
-
ContentDisposition
public ContentDisposition(String header, boolean fileNameFix) throws ParseException
- Throws:
ParseException
-
ContentDisposition
public ContentDisposition(HttpHeaderReader reader, boolean fileNameFix) throws ParseException
- Throws:
ParseException
-
-
Method Detail
-
getType
public String getType()
Get the type.- Returns:
- the type
-
getParameters
public Map<String,String> getParameters()
Get the parameters.- Returns:
- the parameters
-
getFileName
public String getFileName()
Get the filename parameter.- Returns:
- the size
-
getCreationDate
public Date getCreationDate()
Get the creation-date parameter.- Returns:
- the creationDate
-
getModificationDate
public Date getModificationDate()
Get the modification-date parameter.- Returns:
- the modificationDate
-
getReadDate
public Date getReadDate()
Get the read-date parameter.- Returns:
- the readDate
-
getSize
public long getSize()
Get the size parameter.- Returns:
- the size
-
toString
public String toString()
Convert the disposition to a "Content-Disposition" header value.
-
toStringBuffer
protected StringBuilder toStringBuffer()
-
addStringParameter
protected void addStringParameter(StringBuilder sb, String name, String p)
-
addDateParameter
protected void addDateParameter(StringBuilder sb, String name, Date p)
-
addLongParameter
protected void addLongParameter(StringBuilder sb, String name, Long p)
-
type
public static ContentDisposition.ContentDispositionBuilder type(String type)
Start building content disposition.- Parameters:
type- the disposition type.- Returns:
- the content disposition builder.
-
-