FileDocCategorySizeDatePackage
MediaFile.javaAPI DocAndroid 1.5 API7437Wed May 06 22:42:00 BST 2009android.media

MediaFile

public class MediaFile extends Object
MediaScanner helper class. {@hide}

Fields Summary
public static String
sFileExtensions
public static final int
FILE_TYPE_MP3
public static final int
FILE_TYPE_M4A
public static final int
FILE_TYPE_WAV
public static final int
FILE_TYPE_AMR
public static final int
FILE_TYPE_AWB
public static final int
FILE_TYPE_WMA
public static final int
FILE_TYPE_OGG
private static final int
FIRST_AUDIO_FILE_TYPE
private static final int
LAST_AUDIO_FILE_TYPE
public static final int
FILE_TYPE_MID
public static final int
FILE_TYPE_SMF
public static final int
FILE_TYPE_IMY
private static final int
FIRST_MIDI_FILE_TYPE
private static final int
LAST_MIDI_FILE_TYPE
public static final int
FILE_TYPE_MP4
public static final int
FILE_TYPE_M4V
public static final int
FILE_TYPE_3GPP
public static final int
FILE_TYPE_3GPP2
public static final int
FILE_TYPE_WMV
private static final int
FIRST_VIDEO_FILE_TYPE
private static final int
LAST_VIDEO_FILE_TYPE
public static final int
FILE_TYPE_JPEG
public static final int
FILE_TYPE_GIF
public static final int
FILE_TYPE_PNG
public static final int
FILE_TYPE_BMP
public static final int
FILE_TYPE_WBMP
private static final int
FIRST_IMAGE_FILE_TYPE
private static final int
LAST_IMAGE_FILE_TYPE
public static final int
FILE_TYPE_M3U
public static final int
FILE_TYPE_PLS
public static final int
FILE_TYPE_WPL
private static final int
FIRST_PLAYLIST_FILE_TYPE
private static final int
LAST_PLAYLIST_FILE_TYPE
private static HashMap
sFileTypeMap
private static HashMap
sMimeTypeMap
public static final String
UNKNOWN_STRING
Constructors Summary
Methods Summary
static voidaddFileType(java.lang.String extension, int fileType, java.lang.String mimeType)

            
            
        sFileTypeMap.put(extension, new MediaFileType(fileType, mimeType));
        sMimeTypeMap.put(mimeType, new Integer(fileType));
    
public static android.media.MediaFile$MediaFileTypegetFileType(java.lang.String path)

        int lastDot = path.lastIndexOf(".");
        if (lastDot < 0)
            return null;
        return sFileTypeMap.get(path.substring(lastDot + 1).toUpperCase());
    
public static intgetFileTypeForMimeType(java.lang.String mimeType)

        Integer value = sMimeTypeMap.get(mimeType);
        return (value == null ? 0 : value.intValue());
    
public static booleanisAudioFileType(int fileType)

    
         
        return ((fileType >= FIRST_AUDIO_FILE_TYPE &&
                fileType <= LAST_AUDIO_FILE_TYPE) ||
                (fileType >= FIRST_MIDI_FILE_TYPE &&
                fileType <= LAST_MIDI_FILE_TYPE));
    
public static booleanisImageFileType(int fileType)

        return (fileType >= FIRST_IMAGE_FILE_TYPE &&
                fileType <= LAST_IMAGE_FILE_TYPE);
    
public static booleanisPlayListFileType(int fileType)

        return (fileType >= FIRST_PLAYLIST_FILE_TYPE &&
                fileType <= LAST_PLAYLIST_FILE_TYPE);
    
public static booleanisVideoFileType(int fileType)

        return (fileType >= FIRST_VIDEO_FILE_TYPE &&
                fileType <= LAST_VIDEO_FILE_TYPE);