All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.getstream.chat.java.models.framework.FileHandler Maven / Gradle / Ivy

There is a newer version: 1.27.2
Show newest version
package io.getstream.chat.java.models.framework;

import io.getstream.chat.java.exceptions.StreamException;
import io.getstream.chat.java.models.Message.ImageSizeRequestObject;
import io.getstream.chat.java.models.Message.MessageUploadFileResponse;
import io.getstream.chat.java.models.Message.MessageUploadImageResponse;
import java.io.File;
import java.util.List;
import java.util.function.Consumer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface FileHandler {

  MessageUploadFileResponse uploadFile(
      @NotNull String channelType,
      @NotNull String channelId,
      @NotNull String userId,
      @Nullable File file,
      @Nullable String contentType)
      throws StreamException;

  MessageUploadImageResponse uploadImage(
      @NotNull String channelType,
      @NotNull String channelId,
      @NotNull String userId,
      @Nullable File file,
      @Nullable String contentType,
      @Nullable List uploadSizes)
      throws StreamException;

  StreamResponseObject deleteFile(
      @NotNull String channelType, @NotNull String channelId, @NotNull String url)
      throws StreamException;

  StreamResponseObject deleteImage(
      @NotNull String channelType, @NotNull String channelId, @NotNull String url)
      throws StreamException;

  void uploadFileAsync(
      @NotNull String channelType,
      @NotNull String channelId,
      @NotNull String userId,
      @Nullable File file,
      @Nullable String contentType,
      @Nullable Consumer onSuccess,
      @Nullable Consumer onError);

  void uploadImageAsync(
      @NotNull String channelType,
      @NotNull String channelId,
      @NotNull String userId,
      @Nullable File file,
      @Nullable String contentType,
      @Nullable List uploadSizes,
      @Nullable Consumer onSuccess,
      @Nullable Consumer onError);

  void deleteFileAsync(
      @NotNull String channelType,
      @NotNull String channelId,
      @NotNull String url,
      @Nullable Consumer onSuccess,
      @Nullable Consumer onError);

  void deleteImageAsync(
      @NotNull String channelType,
      @NotNull String channelId,
      @NotNull String url,
      @Nullable Consumer onSuccess,
      @Nullable Consumer onError);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy