This class provides an association between file extensions, MIME types and media types.
Authors are allowed to associate with a media type with an extension and query what type is associated
with a filename.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
MEDIA_TYPE_ARCHIVE
public static final int MEDIA_TYPE_ARCHIVE
Media Type Archive.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
MEDIA_TYPE_AUDIO
public static final int MEDIA_TYPE_AUDIO
Media Type Audio.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
MEDIA_TYPE_IMAGE
public static final int MEDIA_TYPE_IMAGE
Media Type Image.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
MEDIA_TYPE_PLAY_LIST
public static final int MEDIA_TYPE_PLAY_LIST
Media Type Audio play list.
Since:
JDE 4.3.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
MEDIA_TYPE_TEXT
public static final int MEDIA_TYPE_TEXT
Media Type Text.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
MEDIA_TYPE_UNKNOWN
public static final int MEDIA_TYPE_UNKNOWN
Media Type Unknown.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
MEDIA_TYPE_VIDEO
public static final int MEDIA_TYPE_VIDEO
Media Type Video.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail
getExtensionFromMIMEType
public static StringgetExtensionFromMIMEType(String mimeType)
Return the file extension associated with the MIME type.
Parameters:
mimeType - The MIME type to query on.
Returns:
The file extension that the MIME type is associated with,
or null if the MIME type is unknown or null.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Return the media type associated with a filename. If the media
type cannot be determined from the filename, this method returns
MEDIA_TYPE_UNKNOWN.
Parameters:
filename - The filename to query on.
Returns:
The associated media type (eg. MEDIA_TYPE_IMAGE) or MEDIA_TYPE_UNKNOWN if filename is null.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
getMediaTypeFromMIMEType
public static int getMediaTypeFromMIMEType(String mimeType)
Return the media type associated with the MIME type. If the MIME type
is unknown or null, this method returns MEDIA_TYPE_UNKNOWN.
Parameters:
mimeType - The MIME type to query on.
Returns:
The media type that the MIME type is associated with.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
The associated MIME type (eg. "image/gif"), or null if the
type could not be determined from the filename.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
getNormalizedType
public static StringgetNormalizedType(String mimeType)
Return a normalized MIME type for the provided type. This method removes
parameters on the content type and maps MIME type aliases to the
preferred MIME type. For example, the normalized MIME type for
"audio/mp3" (non-standard) is "audio/mpeg" (as defined in RFC 3003 and
registered with the IANA).
If the MIME type is unknown, the type is returned with any parameters
removed. For example, the normalized type for
"text/x-unknown-type; charset=utf-8" is "text/x-unknown-type".
Parameters:
mimeType - The MIME type to be normalized (may be null, in which
case this method returns null).
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
registerMIMETypeMapping
public static void registerMIMETypeMapping(String typeFrom,
String typeTo)
Register a MIME type mapping, associating one MIME type to another MIME type.
Parameters:
typeFrom - The MIME type that the mapping is queried from.
typeTo - The MIME type that should be returned as a result of the mapping.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
registerType
public static void registerType(String extension,
String mimeType,
int mediaType)
Register a media and MIME type associated with an extension.
Note that this method does not override previously registered types or extensions.
If the extension is already registered, this method does nothing.
Parameters:
extension - The file extension to associate with.
mimeType - The MIME type the extension is associated with.
mediaType - The media type the extension is associated with; this can be MEDIA_TYPE_UNKNOWN or a private constant, but it should typically be one of MEDIA_TYPE_APPLICATION, MEDIA_TYPE_AUDIO, etc.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Copyright 1999-2007 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved. Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. Copyright 2002-2003 Nokia Corporation All Rights Reserved. Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.