ICMediaFileManager

Manages the process of uploading and downloading content for media file attachments.

downloadFile


Downloads a file from a URL.

Operates asynchronously and notifies the result via ICFileDownloadCallback

  Syntax: void downloadFile(URL url, ICFileDownloadCallback callback)

  Parameters:

Parameter

Type

Description

url

URL

The URL of the file to be downloaded.

callback

ICFileDownloadCallback

Invoked to report the result of the operation.

getCachedFile


Used to obtain a previously downloaded file from the local file cache.

  Syntax: File getCachedFile(URL url)

  Return Value: A File instance, if the download exists in the cache, otherwise null.

  Parameters:

Parameter

Type

Description

url

java.net.URL

The URL to be checked.

isFileDownloading


Checks if the manager is currently downloading a file for the given URL.

  Syntax: boolean isFileDownloading(java.net.URL url)

  Return Value: True if the file is currently being downloaded.

  Parameters:

Parameter

Type

Description

url

java.net.URL

The URL of the file that will be checked.

isFileUploading


Checks if the manager is currently uploading a file to the imiconnect platform.

  Syntax: boolean isFileUploading(File file)

  Return Value: True if the file is currently being uploaded.

  Parameters:

Parameter

Type

Description

file

File

The local file to be checked.

uploadFile


Used to upload a file to the imiconnect platform.

This method attempts to infer the mime type of the file from the file extension, for more granular control use uploadFile(File file, String mimeType, ICFileUploadCallback callback)

  Syntax: void uploadFile(File file, ICFileUploadCallback callback)

  Parameters:

Parameter

Type

Description

file

File

The local file to be uploaded.

callback

ICFileUploadCallback

Invoked to report the result of the operation.

uploadFile


Used to upload a file to the imiconnect platform.

  Syntax: void uploadFile(File file, String mimeType, ICFileUploadCallback callback)

  Parameters:

Parameter

Type

Description

file

File

The local file to be uploaded.

mimeType

String

The mimeType of the file.

callback

[ICFileUploadCallback](doc:callbacks#section-icfileuploadcallback)

Invoked to report the result of the operation.

regenrateMediaURL

Regenerates new media URL for given Media URL upon checking expiry.

Syntax: void regenerateMediaURL(URL url, ICRegenerateMediaURLCallback callback)

Parameter

Type

Description

url

URL

Media url

callback

ICRegenerateMediaURLCallback

Invoked to report the result of the operation.