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
Parameters | Type | Description |
---|---|---|
file | File | The file to upload. |
callback | FileUploadCallback | The 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
Parameters | Type | Description |
---|---|---|
file | File | The file to upload. |
mimeType | String | The MIME type of the file. |
callback | FileUploadCallback | The 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
Parameters | Type | Description |
---|---|---|
file | File | The file to check. |
downloadFile
This method downloads the file from the server.
Syntax: fun downloadFile(url: URL, callback: FileDownloadCallback)
Parameters
Parameters | Type | Description |
---|---|---|
url | URL | The URL of the file to download. |
callback | FileDownloadCallback | The 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
Parameters | Type | Description |
---|---|---|
url | URL | The 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
Parameters | Type | Description |
---|---|---|
url | URL | The 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
Parameters | Type | Description |
---|---|---|
url | URL | The URL of the media file. |
callback | RegenerateMediaFileURLCallback | The callback to be invoked when the URL is regenerated. |
Updated about 1 month ago