Package 

Interface FileUploader


  • 
    public interface FileUploader
    
                        

    The FileUploader is responsible for sending and deleting files from given channel

    • Method Detail

      • sendFile

         Result<UploadedFile> sendFile(FileUploadContext uploadContext, File file, ProgressCallback callback)

        Uploads a file within the given uploadContext. Progress can be accessed via callback.

        When the upload is part of sending a message, FileUploadContext.messageId carries the id the message will be sent with.

        The default implementation ignores the extra context and delegates to the corresponding legacy overload: sendFile(channelType, channelId, userId, file, callback) when callback is not null, sendFile(channelType, channelId, userId, file) otherwise.

      • sendFile

         abstract Result<UploadedFile> sendFile(String channelType, String channelId, String userId, File file)

        Uploads a file for the given channel.

      • sendImage

         Result<UploadedFile> sendImage(FileUploadContext uploadContext, File file, ProgressCallback callback)

        Uploads an image within the given uploadContext. Progress can be accessed via callback.

        When the upload is part of sending a message, FileUploadContext.messageId carries the id the message will be sent with.

        The default implementation ignores the extra context and delegates to the corresponding legacy overload: sendImage(channelType, channelId, userId, file, callback) when callback is not null, sendImage(channelType, channelId, userId, file) otherwise.

      • sendImage

         abstract Result<UploadedFile> sendImage(String channelType, String channelId, String userId, File file)

        Uploads an image for the given channel.

      • deleteFile

         Result<Unit> deleteFile(String url)

        Deletes a file not related to any channel.

        Parameters:
        url - The URL of the file to be deleted.
      • deleteImage

         Result<Unit> deleteImage(String url)

        Deletes an image not related to any channel.

        Parameters:
        url - The URL of the image to be deleted.
      • uploadFile

         Result<UploadedFile> uploadFile(File file, ProgressCallback progressCallback)

        Uploads a file not related to any channel. Progress can be accessed via progressCallback.

        Parameters:
        file - The file to be uploaded.
        progressCallback - The callback to be invoked periodically to report upload progress.
      • uploadImage

         Result<UploadedFile> uploadImage(File file, ProgressCallback progressCallback)

        Uploads an image not related to any channel. Progress can be accessed via progressCallback.

        Parameters:
        file - The image to be uploaded.
        progressCallback - The callback to be invoked periodically to report upload progress.