SHOW Signed

net.rim.device.api.io
Class MIMETypeAssociations

java.lang.Object
  |
  +--net.rim.device.api.io.MIMETypeAssociations

public final class MIMETypeAssociations
extends Object

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.

Since:
JDE 4.2.0

Field Summary
 Category: Signed static int MEDIA_TYPE_APPLICATION
          Media Type Applicatin.
 Category: Signed static int MEDIA_TYPE_ARCHIVE
          Media Type Archive.
 Category: Signed static int MEDIA_TYPE_AUDIO
          Media Type Audio.
 Category: Signed static int MEDIA_TYPE_IMAGE
          Media Type Image.
 Category: Signed static int MEDIA_TYPE_TEXT
          Media Type Text.
 Category: Signed static int MEDIA_TYPE_UNKNOWN
          Media Type Unknown.
 Category: Signed static int MEDIA_TYPE_VIDEO
          Media Type Video.
 
Method Summary
 Category: Signed static String getExtensionFromMIMEType(String mimeType)
          Return the file extension associated with the MIME type.
 Category: Signed static int getMediaType(String filename)
          Return the media type associated with a filename.
 Category: Signed static int getMediaTypeFromMIMEType(String mimeType)
          Return the media type associated with the MIME type.
 Category: Signed static String getMIMEType(String filename)
          Return the MIME type associated with a filename.
 Category: Signed static String getNormalizedType(String type)
          Return a normalized MIME type for the provided type.
 Category: Signed static void registerMIMETypeMapping(String typeFrom, String typeTo)
          Register a MIME type mapping; associating one MIME type to another MIME type.
 Category: Signed static void registerType(String extension, String mimeType, int mediaType)
          Register a media and MIME type associated with an extension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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_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_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_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.

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_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_APPLICATION

public static final int MEDIA_TYPE_APPLICATION
Media Type Applicatin.
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

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 return as a result of the mapping.
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.

getMIMEType

public static String getMIMEType(String filename)
Return the MIME type associated with a filename.
Parameters:
filename - The filename to query on.
Returns:
The associated MIME type (eg. "image/gif")
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.

getMediaType

public static int getMediaType(String filename)
Return the media type associated with a filename.
Parameters:
filename - The filename to query on.
Returns:
The associated media type (eg. 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.

getMediaTypeFromMIMEType

public static int getMediaTypeFromMIMEType(String mimeType)
Return the media type associated with the MIME type.
Parameters:
mimeType - The MIME type to query on.
Returns:
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.

getExtensionFromMIMEType

public static String getExtensionFromMIMEType(String mimeType)
Return the file extension associated with the MIME type.
Parameters:
mimeType - The MIME type to query on.
Returns:
Returns the file extension 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.

registerType

public static void registerType(String extension,
                                String mimeType,
                                int mediaType)
Register a media and MIME type associated with an extension. Note this method does not override previously registered ones.
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 (can be 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.

getNormalizedType

public static String getNormalizedType(String type)
Return a normalized MIME type for the provided type. This method removes parameters on the content type and looks in the MIME type mapping database for a suitable match.
Parameters:
type - The MIME type to be queried on.
Returns:
Returns the normalized MIME type.
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.


Copyright 1999-2006 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.