|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.rim.pushsdk.commons.content.ContentType
public class ContentType
Represents a MIME content type.
| Field Summary | |
|---|---|
static String |
APPLICATION_OCTET_STREAM
The application/octet-stream content type used for binary content. |
static String |
APPLICATION_XML
The application/xml content type used for XML content. |
static String |
AUDIO_3GP
The audio/3gpp content type used for 3GP audio. |
static String |
AUDIO_MP4
The audio/mp4 content type used for MP4 audio. |
static String |
AUDIO_MPEG
The audio/mpeg content type used for MPEG audio. |
static String |
BOUNDARY_PARAM
The boundary parameter. |
static String |
CHARSET_PARAM
The charset parameter. |
static String |
CONTENT_TYPE
The content type header name. |
static String |
CONTENT_TYPE_KEY_VALUE_SEPARATOR
The separator between the content type header name and its value. |
static String |
IMAGE_GIF
The image/gif content type used for GIF images. |
static String |
IMAGE_JPEG
The image/jpeg content type used for JPEG images. |
static String |
IMAGE_PNG
The image/png content type used for PNG images. |
static String |
MULTIPART_MIXED
The multipart/mixed content type. |
static String |
MULTIPART_RELATED
The multipart/related content type. |
static String |
TEXT_HTML
The text/html content type used for HTML. |
static String |
TEXT_PLAIN
The text/plain content type used for plain text. |
static String |
TYPE_PARAM
The type parameter. |
static String |
VIDEO_3GP
The video/3gpp content type used for 3GP video. |
static String |
VIDEO_MP4
The video/mp4 content type used for MP4 video. |
static String |
VIDEO_MPEG
The video/mpeg content type used for MPEG video. |
| Constructor Summary | |
|---|---|
ContentType(String contentType)
Constructs a MIME content type with the given content type as a string. |
|
ContentType(String contentType,
Map<String,String> parameters)
Constructs a MIME content type with the given content type and map of parameters and their values. |
|
ContentType(String contentType,
String parameterName,
String parameterValue)
Constructs a MIME content type with the given content type, and one parameter. |
|
| Method Summary | |
|---|---|
void |
addParameter(String parameterName,
String parameterValue)
Adds a parameter. |
String |
getContentType()
Gets the MIME content. |
String |
getParameter(String parameterName)
Gets the value of the parameter with the given name. |
Map<String,String> |
getParameters()
Gets the map of parameters and their values. |
String |
print()
Gets a string of the content type and its parameters in PAP XML format. |
String |
toString()
Constructs a String with all attributes in name = value format. |
void |
writeTo(ByteArrayOutputStream out)
Writes out the string from the print() method as bytes to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String CONTENT_TYPE
public static final String CONTENT_TYPE_KEY_VALUE_SEPARATOR
public static final String APPLICATION_OCTET_STREAM
public static final String APPLICATION_XML
public static final String MULTIPART_MIXED
public static final String MULTIPART_RELATED
public static final String TEXT_PLAIN
public static final String TEXT_HTML
public static final String IMAGE_JPEG
public static final String IMAGE_GIF
public static final String IMAGE_PNG
public static final String AUDIO_MPEG
public static final String AUDIO_MP4
public static final String AUDIO_3GP
public static final String VIDEO_MPEG
public static final String VIDEO_MP4
public static final String VIDEO_3GP
public static final String TYPE_PARAM
public static final String BOUNDARY_PARAM
public static final String CHARSET_PARAM
| Constructor Detail |
|---|
public ContentType(String contentType)
contentType - the content type as a string
public ContentType(String contentType,
String parameterName,
String parameterValue)
contentType - the content type as a stringparameterName - the parameter nameparameterValue - the parameter value
public ContentType(String contentType,
Map<String,String> parameters)
contentType - the content type as a stringparameters - the map of parameters and their values| Method Detail |
|---|
public void addParameter(String parameterName,
String parameterValue)
parameterName - the parameter nameparameterValue - the parameter valuepublic String getParameter(String parameterName)
parameterName - the parameter name
public String getContentType()
public Map<String,String> getParameters()
public void writeTo(ByteArrayOutputStream out)
throws IOException
print() method as bytes to the output stream.
out - the output stream
IOException - if any IO errors occurpublic String print()
public String toString()
String with all attributes in name = value format.
toString in class ObjectString representation of this object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||