MediaFileManager

Manages media files on the server and this interface provides methods to upload and download media files.

Manages media files on the server and this interface provides methods to upload and download media files.

Functions

uploadFile

This method is used to upload a file to the Webex Connect platform.

Syntax:fun uploadFile(file: File, callback: FileUploadCallback)

Parameters

ParametersTypeDescription
fileFileThe file to upload.
callbackFileUploadCallbackThe callback to be invoked when the upload is complete.

uploadFile(file, mimeType)

This method is used to upload a file to the Webex Connect platform.

fun uploadFile(file: File, mimeType: String, callback: FileUploadCallback)

Parameters

ParametersTypeDescription
fileFileThe file to upload.
mimeTypeStringThe MIME type of the file.
callbackFileUploadCallbackThe callback to be invoked when the upload is complete.

isFileUploading

This method checks if the manager is currently uploading a file to the Webex Connect platform.

Syntax: fun isFileUploading(file: File): Boolean

Return: Returnstrue if the file is currently uploading, false otherwise.

Parameters

ParametersTypeDescription
fileFileThe file to check.

downloadFile

This method downloads the file from the server.

Syntax: fun downloadFile(url: URL, callback: FileDownloadCallback)

Parameters

ParametersTypeDescription
urlURLThe URL of the file to download.
callbackFileDownloadCallbackThe callback to be invoked when the download is complete.

isFileDownloading

This method checks if the manager is currently downloading a file for the given URL.

Syntax: fun isFileDownloading(url: URL): Boolean

Return ValueReturns true if the file is currently downloading, false otherwise.

Parameters

ParametersTypeDescription
urlURLThe URL of the file to check

getCachedFile

This method is used to obtain a previously downloaded file from the local file cache.

Syntax: fun getCachedFile(url: URL): File?

Return Value: The cached file, or null if the file is not cached.

Parameters

ParametersTypeDescription
urlURLThe URL of the file.

regenerateMediaURL

This method regenerates new media URL for given Media URL upon checking expiry.

Syntax: fun regenerateMediaURL(url: URL, callback: RegenerateMediaFileURLCallback)

Parameters

ParametersTypeDescription
urlURLThe URL of the media file.
callbackRegenerateMediaFileURLCallbackThe callback to be invoked when the URL is regenerated.