Class S3FileStorage

java.lang.Object
net.n2oapp.framework.sandbox.file_storage.S3FileStorage
All Implemented Interfaces:
FileStorage

public class S3FileStorage extends Object implements FileStorage
Класс хранения файлов в S3 хранилище
  • Constructor Details

    • S3FileStorage

      public S3FileStorage(software.amazon.awssdk.services.s3.S3Client s3Client, String bucketName)
  • Method Details

    • saveFile

      public void saveFile(String projectId, String file, String source)
      Description copied from interface: FileStorage
      Сохранение файла
      Specified by:
      saveFile in interface FileStorage
      Parameters:
      projectId - Идентификатор проекта
      file - Имя файла
      source - Содержимое файла
    • getFileContent

      public String getFileContent(String projectId, String file)
      Description copied from interface: FileStorage
      Получение содержимого файла
      Specified by:
      getFileContent in interface FileStorage
      Parameters:
      projectId - Идентификатор проекта
      file - Имя файла
      Returns:
      Содержимое файла
    • getProjectFiles

      public List<FileModel> getProjectFiles(String projectId)
      Description copied from interface: FileStorage
      Получение списка файлов
      Specified by:
      getProjectFiles in interface FileStorage
      Parameters:
      projectId - Идентификатор проекта
      Returns:
      Список моделей файлов
    • isProjectExists

      public boolean isProjectExists(String projectId)
      Description copied from interface: FileStorage
      Проверка существования проекта
      Specified by:
      isProjectExists in interface FileStorage
      Parameters:
      projectId - Идентификатор проекта
      Returns:
      true - проект существует, false - проект не существует