-
public interface FileUploaderThe FileUploader is responsible for sending and deleting files from given channel
-
-
Method Summary
Modifier and Type Method Description Result<UploadedFile>sendFile(FileUploadContext uploadContext, File file, ProgressCallback callback)Uploads a file within the given uploadContext. abstract Result<UploadedFile>sendFile(String channelType, String channelId, String userId, File file, ProgressCallback callback)Uploads a file for the given channel. abstract Result<UploadedFile>sendFile(String channelType, String channelId, String userId, File file)Uploads a file for the given channel. Result<UploadedFile>sendImage(FileUploadContext uploadContext, File file, ProgressCallback callback)Uploads an image within the given uploadContext. abstract Result<UploadedFile>sendImage(String channelType, String channelId, String userId, File file, ProgressCallback callback)Uploads an image for the given channel. abstract Result<UploadedFile>sendImage(String channelType, String channelId, String userId, File file)Uploads an image for the given channel. abstract Result<Unit>deleteFile(String channelType, String channelId, String userId, String url)Deletes the file represented by url from the given channel. Result<Unit>deleteFile(String url)Deletes a file not related to any channel. abstract Result<Unit>deleteImage(String channelType, String channelId, String userId, String url)Deletes the image represented by url from the given channel. Result<Unit>deleteImage(String url)Deletes an image not related to any channel. Result<UploadedFile>uploadFile(File file, ProgressCallback progressCallback)Uploads a file not related to any channel. Result<UploadedFile>uploadImage(File file, ProgressCallback progressCallback)Uploads an image not related to any 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, ProgressCallback callback)
Uploads a file for the given channel. Progress can be accessed via callback.
-
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, ProgressCallback callback)
Uploads an image for the given channel. Progress can be accessed via callback.
-
sendImage
abstract Result<UploadedFile> sendImage(String channelType, String channelId, String userId, File file)
Uploads an image for the given channel.
-
deleteFile
abstract Result<Unit> deleteFile(String channelType, String channelId, String userId, String url)
Deletes the file represented by url from 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
abstract Result<Unit> deleteImage(String channelType, String channelId, String userId, String url)
Deletes the image represented by url from the given channel.
-
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.
-
-
-
-