public class

MimeTypeMap

extends Object
java.lang.Object
   ↳ android.webkit.MimeTypeMap

Class Overview

Two-way map that maps MIME-types to file extensions and vice versa.

Summary

Public Methods
String getExtensionFromMimeType(String mimeType)
static String getFileExtensionFromUrl(String url)
Returns the file extension or an empty string iff there is no extension.
String getMimeTypeFromExtension(String extension)
static MimeTypeMap getSingleton()
boolean hasExtension(String extension)
boolean hasMimeType(String mimeType)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public String getExtensionFromMimeType (String mimeType)

Since: API Level 1

Returns
  • The MIME type for the extension or null iff there is none.

public static String getFileExtensionFromUrl (String url)

Since: API Level 1

Returns the file extension or an empty string iff there is no extension.

public String getMimeTypeFromExtension (String extension)

Since: API Level 1

Returns
  • The extension for the MIME type or null iff there is none.

public static MimeTypeMap getSingleton ()

Since: API Level 1

Returns
  • The singleton instance of the MIME-type map.

public boolean hasExtension (String extension)

Since: API Level 1

Returns
  • True iff there is an extension entry in the map.

public boolean hasMimeType (String mimeType)

Since: API Level 1

Returns
  • True iff there is a mimeType entry in the map.