Interface FileUploader
-
- All Implemented Interfaces:
public interface FileUploaderThe FileUploader is responsible for sending and deleting files from given channel
-
-
Method Summary
Modifier and Type Method Description 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. 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. abstract Result<Unit>deleteImage(String channelType, String channelId, String userId, String url)Deletes the image represented by url from the given channel. -
-
Method Detail
-
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.
- Returns:
The Result object containing an instance of UploadedFile in the case of a successful upload or an exception if the upload had failed.
-
sendFile
abstract Result<UploadedFile> sendFile(String channelType, String channelId, String userId, File file)
Uploads a file for the given channel.
- Returns:
The Result object containing an instance of UploadedFile in the case of a successful upload or an exception if the upload had failed.
-
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.
- Returns:
The Result object containing an instance of UploadedFile in the case of a successful upload or an exception if the upload had failed.
-
sendImage
abstract Result<UploadedFile> sendImage(String channelType, String channelId, String userId, File file)
Uploads an image for the given channel.
- Returns:
The Result object containing an instance of UploadedFile in the case of a successful upload or an exception if the upload had failed.
-
deleteFile
abstract Result<Unit> deleteFile(String channelType, String channelId, String userId, String url)
Deletes the file represented by url from the given channel.
- Returns:
The empty Result object, or Result object with exception if the operation failed.
-
-
-
-