FileTypes
@UnstableApi
public final class FileTypes
Defines common file type constants and helper methods.
Summary
Nested types |
|---|
@DocumentedFile types. |
Constants |
|
|---|---|
static final int |
AC3 = 0File type for the AC-3 and E-AC-3 formats. |
static final int |
AC4 = 1File type for the AC-4 format. |
static final int |
ADTS = 2File type for the ADTS format. |
static final int |
AMR = 3File type for the AMR format. |
static final int |
AVI = 16File type for the AVI format. |
static final int |
AVIF = 21File type for the AVIF format. |
static final int |
BMP = 19File type for the BMP format. |
static final int |
FLAC = 4File type for the FLAC format. |
static final int |
FLV = 5File type for the FLV format. |
static final int |
HEIF = 20File type for the HEIF format. |
static final int |
JPEG = 14File type for the JPEG format. |
static final int |
MATROSKA = 6File type for the Matroska and WebM formats. |
static final int |
MIDI = 15File type for the MIDI format. |
static final int |
MP3 = 7File type for the MP3 format. |
static final int |
MP4 = 8File type for the MP4 format. |
static final int |
OGG = 9File type for the Ogg format. |
static final int |
PNG = 17File type for the PNG format. |
static final int |
PS = 10File type for the MPEG-PS format. |
static final int |
TS = 11File type for the MPEG-TS format. |
static final int |
UNKNOWN = -1Unknown file type. |
static final int |
WAV = 12File type for the WAV format. |
static final int |
WEBP = 18File type for the WEBP format. |
static final int |
WEBVTT = 13File type for the WebVTT format. |
Public methods |
|
|---|---|
static int |
@FileTypes.TypeReturns the |
static int |
@FileTypes.TypeReturns the |
static int |
Constants
Public methods
inferFileTypeFromMimeType
@FileTypes.Type
public static int inferFileTypeFromMimeType(@Nullable String mimeType)
Returns the Type corresponding to the MIME type provided.
Returns UNKNOWN if the MIME type is null.
inferFileTypeFromResponseHeaders
@FileTypes.Type
public static int inferFileTypeFromResponseHeaders(
Map<String, List<String>> responseHeaders
)
Returns the Type corresponding to the response headers provided.