-
public class MediaType.Companion
-
-
Field Summary
-
Method Summary
Modifier and Type Method Description final MediaTypeinvoke(String string)Creates a MediaType from its RFC 6838 string representation. final MediaTypeparse(String string, String name, String fileExtension)final MediaTypeof(String mediaType)final MediaTypeof(String mediaType, String fileExtension)Resolves a format from a single file extension and media type hint, without checking the actual content. final MediaTypeof(List<String> mediaTypes, List<String> fileExtensions)Resolves a format from file extension and media type hints, without checking the actual content. final MediaTypeof(File file, String mediaType, String fileExtension)final MediaTypeof(File file, List<String> mediaTypes, List<String> fileExtensions)final MediaTypeof(Function0<ByteArray> bytes, String mediaType, String fileExtension)final MediaTypeof(Function0<ByteArray> bytes, List<String> mediaTypes, List<String> fileExtensions)final MediaTypeof(Uri uri, ContentResolver contentResolver, String mediaType, String fileExtension)final MediaTypeof(Uri uri, ContentResolver contentResolver, List<String> mediaTypes, List<String> fileExtensions)final MediaTypeofFile(File file, String mediaType, String fileExtension)Resolves a format from a local file path. final MediaTypeofFile(File file, List<String> mediaTypes, List<String> fileExtensions)Resolves a format from a local file path. final MediaTypeofFile(String path, String mediaType, String fileExtension)Resolves a format from a local file path. final MediaTypeofFile(String path, List<String> mediaTypes, List<String> fileExtensions)Resolves a format from a local file path. final MediaTypeofBytes(Function0<ByteArray> bytes, String mediaType, String fileExtension)Resolves a format from bytes, e.g. final MediaTypeofBytes(Function0<ByteArray> bytes, List<String> mediaTypes, List<String> fileExtensions)Resolves a format from bytes, e.g. final MediaTypeofUri(Uri uri, ContentResolver contentResolver, String mediaType, String fileExtension)Resolves a format from a content URI and a ContentResolver. final MediaTypeofUri(Uri uri, ContentResolver contentResolver, List<String> mediaTypes, List<String> fileExtensions)Resolves a format from a content URI and a ContentResolver. final MediaTypegetAAC()final MediaTypegetACSM()final MediaTypegetAIFF()final MediaTypegetAVI()final MediaTypegetAVIF()final MediaTypegetBINARY()final MediaTypegetBMP()final MediaTypegetCBR()final MediaTypegetCBZ()final MediaTypegetCSS()final MediaTypegetDIVINA()final MediaTypegetDIVINA_MANIFEST()final MediaTypegetEPUB()final MediaTypegetFLAC()final MediaTypegetGIF()final MediaTypegetGZ()final MediaTypegetHTML()final MediaTypegetJAVASCRIPT()final MediaTypegetJPEG()final MediaTypegetJSON()final MediaTypegetJSON_PROBLEM_DETAILS()final MediaTypegetJXL()final MediaTypegetLCP_LICENSE_DOCUMENT()final MediaTypegetLCP_PROTECTED_AUDIOBOOK()final MediaTypegetLCP_PROTECTED_PDF()final MediaTypegetLCP_STATUS_DOCUMENT()final MediaTypegetLPF()final MediaTypegetMP3()final MediaTypegetMP4()final MediaTypegetMPEG()final MediaTypegetNCX()final MediaTypegetOGG()final MediaTypegetOGV()final MediaTypegetOPDS1()final MediaTypegetOPDS1_NAVIGATION_FEED()final MediaTypegetOPDS1_ACQUISITION_FEED()final MediaTypegetOPDS1_ENTRY()final MediaTypegetOPDS2()final MediaTypegetOPDS2_PUBLICATION()final MediaTypegetOPDS_AUTHENTICATION()final MediaTypegetOPUS()final MediaTypegetOTF()final MediaTypegetPDF()final MediaTypegetPNG()final MediaTypegetRAR()final MediaTypegetREADIUM_AUDIOBOOK()final MediaTypegetREADIUM_AUDIOBOOK_MANIFEST()final MediaTypegetREADIUM_WEBPUB()final MediaTypegetREADIUM_WEBPUB_MANIFEST()final MediaTypegetSMIL()final MediaTypegetSVG()final MediaTypegetTEXT()final MediaTypegetTIFF()final MediaTypegetTTF()final MediaTypegetW3C_WPUB_MANIFEST()final MediaTypegetWAV()final MediaTypegetWEBM_AUDIO()final MediaTypegetWEBM_VIDEO()final MediaTypegetWEBP()final MediaTypegetWOFF()final MediaTypegetWOFF2()final MediaTypegetXHTML()final MediaTypegetXML()final MediaTypegetZAB()final MediaTypegetZIP()final List<Object>getSniffers()The default sniffers provided by Readium 2 to resolve a MediaType. final MediaTypegetAUDIOBOOK()final MediaTypegetAUDIOBOOK_MANIFEST()final MediaTypegetWEBPUB()final MediaTypegetWEBPUB_MANIFEST()final MediaTypegetOPDS1_FEED()final MediaTypegetOPDS2_FEED()final MediaTypegetLCP_LICENSE()-
-
Method Detail
-
invoke
final MediaType invoke(String string)
Creates a MediaType from its RFC 6838 string representation.
-
parse
@Deprecated(message = Use `MediaType(string)` instead, replaceWith = @ReplaceWith(imports = {}, expression = MediaType(string)), level = DeprecationLevel.ERROR) final MediaType parse(String string, String name, String fileExtension)
-
of
@Deprecated(message = Create the `MediaType` directly instead, replaceWith = @ReplaceWith(imports = {}, expression = MediaType(mediaType)), level = DeprecationLevel.ERROR) final MediaType of(String mediaType)
-
of
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType of(String mediaType, String fileExtension)
Resolves a format from a single file extension and media type hint, without checking the actual content.
-
of
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType of(List<String> mediaTypes, List<String> fileExtensions)
Resolves a format from file extension and media type hints, without checking the actual content.
-
of
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType of(File file, String mediaType, String fileExtension)
-
of
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType of(File file, List<String> mediaTypes, List<String> fileExtensions)
-
of
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType of(Function0<ByteArray> bytes, String mediaType, String fileExtension)
-
of
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType of(Function0<ByteArray> bytes, List<String> mediaTypes, List<String> fileExtensions)
-
of
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType of(Uri uri, ContentResolver contentResolver, String mediaType, String fileExtension)
-
of
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType of(Uri uri, ContentResolver contentResolver, List<String> mediaTypes, List<String> fileExtensions)
-
ofFile
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType ofFile(File file, String mediaType, String fileExtension)
Resolves a format from a local file path.
-
ofFile
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType ofFile(File file, List<String> mediaTypes, List<String> fileExtensions)
Resolves a format from a local file path.
-
ofFile
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType ofFile(String path, String mediaType, String fileExtension)
Resolves a format from a local file path.
-
ofFile
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType ofFile(String path, List<String> mediaTypes, List<String> fileExtensions)
Resolves a format from a local file path.
-
ofBytes
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType ofBytes(Function0<ByteArray> bytes, String mediaType, String fileExtension)
Resolves a format from bytes, e.g. from an HTTP response.
-
ofBytes
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType ofBytes(Function0<ByteArray> bytes, List<String> mediaTypes, List<String> fileExtensions)
Resolves a format from bytes, e.g. from an HTTP response.
-
ofUri
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType ofUri(Uri uri, ContentResolver contentResolver, String mediaType, String fileExtension)
Resolves a format from a content URI and a ContentResolver. Accepts the following URI schemes: content, android.resource, file.
-
ofUri
@Deprecated(message = Use an `AssetRetriever` instead to retrieve the format of a file. See the migration guide., level = DeprecationLevel.ERROR) final MediaType ofUri(Uri uri, ContentResolver contentResolver, List<String> mediaTypes, List<String> fileExtensions)
Resolves a format from a content URI and a ContentResolver. Accepts the following URI schemes: content, android.resource, file.
-
getDIVINA_MANIFEST
final MediaType getDIVINA_MANIFEST()
-
getJAVASCRIPT
final MediaType getJAVASCRIPT()
-
getJSON_PROBLEM_DETAILS
final MediaType getJSON_PROBLEM_DETAILS()
-
getLCP_LICENSE_DOCUMENT
final MediaType getLCP_LICENSE_DOCUMENT()
-
getLCP_PROTECTED_AUDIOBOOK
final MediaType getLCP_PROTECTED_AUDIOBOOK()
-
getLCP_PROTECTED_PDF
final MediaType getLCP_PROTECTED_PDF()
-
getLCP_STATUS_DOCUMENT
final MediaType getLCP_STATUS_DOCUMENT()
-
getOPDS1_NAVIGATION_FEED
final MediaType getOPDS1_NAVIGATION_FEED()
-
getOPDS1_ACQUISITION_FEED
final MediaType getOPDS1_ACQUISITION_FEED()
-
getOPDS1_ENTRY
final MediaType getOPDS1_ENTRY()
-
getOPDS2_PUBLICATION
final MediaType getOPDS2_PUBLICATION()
-
getOPDS_AUTHENTICATION
final MediaType getOPDS_AUTHENTICATION()
-
getREADIUM_AUDIOBOOK
final MediaType getREADIUM_AUDIOBOOK()
-
getREADIUM_AUDIOBOOK_MANIFEST
final MediaType getREADIUM_AUDIOBOOK_MANIFEST()
-
getREADIUM_WEBPUB
final MediaType getREADIUM_WEBPUB()
-
getREADIUM_WEBPUB_MANIFEST
final MediaType getREADIUM_WEBPUB_MANIFEST()
-
getW3C_WPUB_MANIFEST
final MediaType getW3C_WPUB_MANIFEST()
-
getWEBM_AUDIO
final MediaType getWEBM_AUDIO()
-
getWEBM_VIDEO
final MediaType getWEBM_VIDEO()
-
getSniffers
final List<Object> getSniffers()
The default sniffers provided by Readium 2 to resolve a MediaType. You can register additional sniffers globally by modifying this list. The sniffers order is important, because some formats are subsets of other formats.
-
getAUDIOBOOK
final MediaType getAUDIOBOOK()
-
getAUDIOBOOK_MANIFEST
final MediaType getAUDIOBOOK_MANIFEST()
-
getWEBPUB_MANIFEST
final MediaType getWEBPUB_MANIFEST()
-
getOPDS1_FEED
final MediaType getOPDS1_FEED()
-
getOPDS2_FEED
final MediaType getOPDS2_FEED()
-
getLCP_LICENSE
final MediaType getLCP_LICENSE()
-
-
-
-