FileStorage

interface FileStorage

Functions

abortFileUploading
Link copied to clipboard
open fun abortFileUploading(fileDescriptor: RainbowFileDescriptor)
Cancel the upload started on the RainbowFileDescriptor.
addViewerToFileDescriptor
Link copied to clipboard
abstract fun addViewerToFileDescriptor(fileDescriptor: RainbowFileDescriptor, viewer: RainbowFileViewer, listener: IFileProxy.IAddViewerListener?)
Adds a RainbowFileViewer to a RainbowFileDescriptor The specified viewer will have access to the RainbowFileDescriptor, they will be able to download and view the file.
cancelDownload
Link copied to clipboard
abstract fun cancelDownload(fileDescriptor: RainbowFileDescriptor): Boolean
Cancel the download started on the RainbowFileDescriptor.
cancelUpload
Link copied to clipboard
abstract fun cancelUpload(fileDescriptor: RainbowFileDescriptor)
Cancel the upload started on the RainbowFileDescriptor.
deleteAllDownloadedFiles
Link copied to clipboard
abstract fun deleteAllDownloadedFiles()
Deletes all previously downloaded files on the device
deleteAllFileDescriptors
Link copied to clipboard
abstract fun deleteAllFileDescriptors(listener: IFileProxy.IDeleteAllFileDescriptorListener?)
Deletes all RainbowFileDescriptor owned by the user Due to the delay to remove all files from the server, the treatment is asynchronous and the callback is triggered almost immediately with a success if the server has started to delete the files
deleteFileDescriptor
Link copied to clipboard
abstract fun deleteFileDescriptor(fileDescriptor: RainbowFileDescriptor, listener: IFileProxy.IDeleteFileDescriptorListener?)
Deletes the RainbowFileDescriptor from the server If the file has been downloaded to the device, it will be delete Viewers will no longer have access to the file once it has been deleted
deleteFileDescriptors
Link copied to clipboard
abstract fun deleteFileDescriptors(fileDescriptors: List<RainbowFileDescriptor>, listener: IFileProxy.IDeleteFileDescriptorListener?)
Deletes a list of RainbowFileDescriptor from the server
deleteFileDescriptorsViewer
Link copied to clipboard
abstract fun deleteFileDescriptorsViewer(fileDescriptors: List<RainbowFileDescriptor>, viewerIdToDelete: String, listener: IFileProxy.IDeleteViewerListener?)
Deletes a given viewer from a list of RainbowFileDescriptor
deleteFileDescriptorViewer
Link copied to clipboard
abstract fun deleteFileDescriptorViewer(fileDescriptor: RainbowFileDescriptor, viewerIdToDelete: String, listener: IFileProxy.IDeleteViewerListener?)
Deletes a given viewer from a RainbowFileDescriptor The user must be a current viewer of the RainbowFileDescriptor, once deleted, they will no longer have access to it
downloadFile
Link copied to clipboard
abstract fun downloadFile(fileDescriptor: RainbowFileDescriptor, listener: IFileProxy.IDownloadPublicFileListener?)
Download the file from the server.
fetchFileDescriptorById
Link copied to clipboard
abstract fun fetchFileDescriptorById(fileDescriptorId: String?, listener: IFileProxy.IGetFileDescriptorListener?): RainbowFileDescriptor?
Returns a RainbowFileDescriptor and fetch last data from the server This method resolve the RainbowFileDescriptor from the server, it returns immediately the local RainbowFileDescriptor if found or null otherwise.
fetchFileReceived
Link copied to clipboard
abstract fun fetchFileReceived(limit: Int, offset: Int, listener: IFileProxy.IRefreshListener?)
Fetches a list of received RainbowFileDescriptor This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results.
fetchFileReceivedInBubble
Link copied to clipboard
abstract fun fetchFileReceivedInBubble(room: Room, limit: Int, offset: Int, listener: IFileProxy.IRefreshListener?)
Fetches a list of RainbowFileDescriptor received in a bubble conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results.
fetchFileReceivedInConversation
Link copied to clipboard
abstract fun fetchFileReceivedInConversation(conversation: IRainbowConversation, limit: Int, offset: Int, listener: IFileProxy.IRefreshListener?)
Fetches a list of RainbowFileDescriptor received in a conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results.
fetchFileSent
Link copied to clipboard
abstract fun fetchFileSent(limit: Int, offset: Int, listener: IFileProxy.IRefreshListener?)
Fetches a list of sent RainbowFileDescriptor This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results.
fetchFileSentInBubble
Link copied to clipboard
abstract fun fetchFileSentInBubble(room: Room, limit: Int, offset: Int, listener: IFileProxy.IRefreshListener?)
Fetches a list of RainbowFileDescriptor sent in a bubble conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results.
fetchFileSentInConversation
Link copied to clipboard
abstract fun fetchFileSentInConversation(conversation: IRainbowConversation, limit: Int, offset: Int, listener: IFileProxy.IRefreshListener?)
Fetches a list of RainbowFileDescriptor sent in a conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results.
fileOwnershipChange
Link copied to clipboard
abstract fun fileOwnershipChange(fileDescriptor: RainbowFileDescriptor, ownerId: String, listener: IFileProxy.IFileOwnershipChangeListener?)
Drops the ownership to another Rainbow user of the same company The user must be in the same company and allowed by administrator
getFileDescriptorById
Link copied to clipboard
abstract fun getFileDescriptorById(fileDescriptorId: String): RainbowFileDescriptor?
Returns a RainbowFileDescriptor if found in local list
getFileDownloaded
Link copied to clipboard
abstract fun getFileDownloaded(fileDescriptor: RainbowFileDescriptor): File?
Retrieves the downloaded file associated to the RainbowFileDescriptor from the device
getUserQuotaConsumption
Link copied to clipboard
abstract fun getUserQuotaConsumption(listener: IFileProxy.IGetConsumptionListener)
Retrieves the current file storage consumption and quota associated to the connected user The callback returns a Consumption object with the following properties (quota: Long, consumption: Long, unit: String)
isDownloaded
Link copied to clipboard
abstract fun isDownloaded(fileDescriptor: RainbowFileDescriptor): Boolean
Checks if the file has already been downloaded to the device
removeFile
Link copied to clipboard
open fun removeFile(fileDescriptor: RainbowFileDescriptor, listener: IFileProxy.IDeleteFileDescriptorListener?)
Remove an uploaded file This method is deprecated, use deleteFileDescriptor instead
uploadFileDescriptorToPersonalStorage
Link copied to clipboard
abstract fun uploadFileDescriptorToPersonalStorage(fileDescriptor: RainbowFileDescriptor, hidePurpose: Boolean = false, listener: IFileProxy.IGetFileDescriptorListener?)
As a viewer of the RainbowFileDescriptor, upload a copy in the user personal storage A new RainbowFileDescriptor will be created with the user as owner.
uploadFileToBubble
Link copied to clipboard
abstract fun uploadFileToBubble(room: Room, uriFile: Uri, listener: IFileProxy.IUploadFileListener?)
Uploads a file to a bubble A new RainbowFileDescriptor will be create with the user as the owner, the bubble will be a viewer for this RainbowFileDescriptor.
uploadFileToChannel
Link copied to clipboard
abstract fun uploadFileToChannel(channel: Channel, uriFile: Uri, listener: IFileProxy.IUploadFileListener?)
Uploads a file to a channel A new RainbowFileDescriptor will be create with the user as the owner, the channel will be a viewer for this RainbowFileDescriptor.
uploadFileToConversation
Link copied to clipboard
abstract fun uploadFileToConversation(conversation: IRainbowConversation, uriFile: Uri, listener: IFileProxy.IUploadFileListener?)
Uploads a file to a conversation A new RainbowFileDescriptor will be create with the user as the owner, the IRainbowConversation will be a viewer for this RainbowFileDescriptor whether it's a contact or a bubble.